mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2026-01-06 01:53:16 -06:00
don't use ErrNoEntries on delete when not needed (it's only needed for a RETURNING call)
This commit is contained in:
parent
1e7ad8e5cf
commit
3c1fb1a0f1
1 changed files with 3 additions and 2 deletions
|
|
@ -303,7 +303,8 @@ func (s *statusBookmarkDB) DeleteStatusBookmarks(ctx context.Context, targetAcco
|
||||||
q = q.Where("? = ?", bun.Ident("account_id"), originAccountID)
|
q = q.Where("? = ?", bun.Ident("account_id"), originAccountID)
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, err := q.Exec(ctx); err != nil {
|
if _, err := q.Exec(ctx); err != nil &&
|
||||||
|
!errors.Is(err, db.ErrNoEntries) {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -323,7 +324,7 @@ func (s *statusBookmarkDB) DeleteStatusBookmarksForStatus(ctx context.Context, s
|
||||||
q := s.db.NewDelete().
|
q := s.db.NewDelete().
|
||||||
TableExpr("? AS ?", bun.Ident("status_bookmarks"), bun.Ident("status_bookmark")).
|
TableExpr("? AS ?", bun.Ident("status_bookmarks"), bun.Ident("status_bookmark")).
|
||||||
Where("? = ?", bun.Ident("status_bookmark.status_id"), statusID)
|
Where("? = ?", bun.Ident("status_bookmark.status_id"), statusID)
|
||||||
if _, err := q.Exec(ctx); err != nil && !errors.Is(err, db.ErrNoEntries) {
|
if _, err := q.Exec(ctx); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue