UPDATE: Fix cookie
All checks were successful
Build and Release / release (push) Successful in 59s

This commit is contained in:
2026-03-31 10:58:05 +07:00
parent 338f6da83c
commit 8e2dcb817f
20 changed files with 407 additions and 195 deletions

View File

@@ -1,16 +1,11 @@
-- name: CreateMedia :one
INSERT INTO medias (
user_id, storage_key, original_name, mime_type, size, target_type, target_id, file_metadata
user_id, storage_key, original_name, mime_type, size, file_metadata
) VALUES (
$1, $2, $3, $4, $5, $6, $7, $8
$1, $2, $3, $4, $5, $6
)
RETURNING *;
-- name: GetMediasByTarget :many
SELECT * FROM medias
WHERE target_type = $1 AND target_id = $2
ORDER BY created_at DESC;
-- name: DeleteMedia :exec
DELETE FROM medias
WHERE id = $1;
@@ -20,7 +15,6 @@ SELECT *
FROM medias
WHERE
(sqlc.narg('cursor')::uuid IS NULL OR id > sqlc.narg('cursor')::uuid)
AND (sqlc.narg('target_types')::varchar[] IS NULL OR target_type = ANY(sqlc.narg('target_types')::varchar[]))
AND (
sqlc.narg('search_text')::text IS NULL OR
original_name ILIKE '%' || sqlc.narg('search_text')::text || '%' OR