Skip to content

Commit 1b94794

Browse files
committed
fix: 修复tagId为0入库
1 parent 214ca2b commit 1b94794

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

internal/logic/sentence/sentence.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ func Cre(ctx context.Context, in *model.SentenceInput) (err error) {
3030
// 插入标签关联表数据
3131
var sentenceTags []do.SentenceTag
3232
for _, tagId := range in.TagIds {
33+
if tagId == 0 {
34+
continue
35+
}
3336
sentenceTags = append(sentenceTags, do.SentenceTag{
3437
SId: lastId,
3538
TId: tagId,

0 commit comments

Comments
 (0)