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:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user