fix(delete): update delete operations to return affected rows for cabinets, rooms, and warehouses
This commit is contained in:
@@ -49,14 +49,17 @@ func (q *Queries) CreateRoom(ctx context.Context, arg CreateRoomParams) (Room, e
|
||||
return i, err
|
||||
}
|
||||
|
||||
const deleteRoom = `-- name: DeleteRoom :exec
|
||||
const deleteRoom = `-- name: DeleteRoom :execrows
|
||||
DELETE FROM rooms
|
||||
WHERE id = $1
|
||||
`
|
||||
|
||||
func (q *Queries) DeleteRoom(ctx context.Context, id int64) error {
|
||||
_, err := q.db.Exec(ctx, deleteRoom, id)
|
||||
return err
|
||||
func (q *Queries) DeleteRoom(ctx context.Context, id int64) (int64, error) {
|
||||
result, err := q.db.Exec(ctx, deleteRoom, id)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return result.RowsAffected(), nil
|
||||
}
|
||||
|
||||
const getRoomByID = `-- name: GetRoomByID :one
|
||||
|
||||
Reference in New Issue
Block a user