mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-30 09:46:15 -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)
|
||||
}
|
||||
|
||||
if _, err := q.Exec(ctx); err != nil {
|
||||
if _, err := q.Exec(ctx); err != nil &&
|
||||
!errors.Is(err, db.ErrNoEntries) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -323,7 +324,7 @@ func (s *statusBookmarkDB) DeleteStatusBookmarksForStatus(ctx context.Context, s
|
|||
q := s.db.NewDelete().
|
||||
TableExpr("? AS ?", bun.Ident("status_bookmarks"), bun.Ident("status_bookmark")).
|
||||
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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue