Compare commits

..

No commits in common. "8158fff075d7c2f2ebd699ba145a6c5b7e865053" and "c20b9143db8d44751e0ee4e41bc94a8d9f32a501" have entirely different histories.

2 changed files with 2 additions and 5 deletions

View File

@ -188,10 +188,7 @@ func CreateTagAlias(ctx context.Context, db *gorm.DB, tagAliasName models.Anthro
return &otterError.EntityValidationFailed{Reason: otterError.AnthroveTagIDEmpty} return &otterError.EntityValidationFailed{Reason: otterError.AnthroveTagIDEmpty}
} }
result := db.WithContext(ctx).Clauses(clause.OnConflict{ result := db.WithContext(ctx).Create(&models.TagAlias{
Columns: []clause.Column{{Name: "name"}},
DoNothing: true,
}).Create(&models.TagAlias{
Name: string(tagAliasName), Name: string(tagAliasName),
TagID: string(tagID), TagID: string(tagID),
}) })

View File

@ -328,7 +328,7 @@ func TestCreateTagAlias(t *testing.T) {
tagAliasName: validTagAliasName01, tagAliasName: validTagAliasName01,
tagID: validTagID, tagID: validTagID,
}, },
wantErr: false, wantErr: true,
}, },
{ {
name: "Test 6: Invalide tagID", name: "Test 6: Invalide tagID",