Skip to content

Commit

Permalink
fix: 修复tagId为0入库
Browse files Browse the repository at this point in the history
  • Loading branch information
oldme-git committed Nov 22, 2024
1 parent 214ca2b commit 1b94794
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/logic/sentence/sentence.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ func Cre(ctx context.Context, in *model.SentenceInput) (err error) {
// 插入标签关联表数据
var sentenceTags []do.SentenceTag
for _, tagId := range in.TagIds {
if tagId == 0 {
continue
}
sentenceTags = append(sentenceTags, do.SentenceTag{
SId: lastId,
TId: tagId,
Expand Down

0 comments on commit 1b94794

Please sign in to comment.