Drop RowsAffected check from Delete methods

Deletes are idempotent — zero affected rows is not an error.

Signed-off-by: Émile Ré <emile@probo.com>
This commit is contained in:
Émile Ré
2026-05-19 11:08:01 +04:00
parent f1357a7e20
commit 0c89a4b241
4 changed files with 12 additions and 16 deletions

View File

@@ -429,15 +429,11 @@ func (t CommonThirdParty) Delete(
args := pgx.StrictNamedArgs{"id": id}
result, err := conn.Exec(ctx, q, args)
_, err := conn.Exec(ctx, q, args)
if err != nil {
return fmt.Errorf("cannot delete common third party: %w", err)
}
if result.RowsAffected() == 0 {
return ErrResourceNotFound
}
return nil
}