Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
trim21 committed Oct 9, 2024
1 parent 494b3e9 commit 5c70f95
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions internal/collections/infra/mysql_repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,9 @@ func (r mysqlRepo) updateOrCreateSubjectCollection(
slices.Sort(newTags)

err = r.q.Transaction(func(tx *query.Query) error {
sanitizedTags, err := r.updateUserTags(ctx, tx, userID, subject, at, s)
if err != nil {
return errgo.Trace(err)
sanitizedTags, txErr := r.updateUserTags(ctx, tx, userID, subject, at, s)
if txErr != nil {
return errgo.Trace(txErr)
}

sort.Strings(sanitizedTags)
Expand All @@ -175,6 +175,9 @@ func (r mysqlRepo) updateOrCreateSubjectCollection(

return errgo.Trace(r.q.SubjectCollection.WithContext(ctx).Clauses(clause.OnConflict{UpdateAll: true}).Create(obj))
})
if err != nil {
return err
}

if slices.Equal(relatedTags, newTags) {
relatedTags = nil
Expand Down

0 comments on commit 5c70f95

Please sign in to comment.