feat: add cabinet management functionality
This commit is contained in:
@@ -112,7 +112,7 @@ func (q *Queries) ListCabinets(ctx context.Context) ([]Cabinet, error) {
|
||||
|
||||
const updateCabinet = `-- name: UpdateCabinet :one
|
||||
UPDATE cabinets
|
||||
SET name = coalesce($1, name),
|
||||
SET name = CASE WHEN $1 = '' THEN name ELSE $1 END,
|
||||
description = coalesce($2, description),
|
||||
updated_at = $3
|
||||
WHERE id = $4
|
||||
@@ -120,7 +120,7 @@ RETURNING id, room_id, name, description, created_at, updated_at
|
||||
`
|
||||
|
||||
type UpdateCabinetParams struct {
|
||||
Name string `db:"name" json:"name"`
|
||||
Name interface{} `db:"name" json:"name"`
|
||||
Description pgtype.Text `db:"description" json:"description"`
|
||||
UpdatedAt time.Time `db:"updated_at" json:"updatedAt"`
|
||||
ID int64 `db:"id" json:"id"`
|
||||
|
||||
Reference in New Issue
Block a user