feat: now PostImage return Image struct even on duplicate data
All checks were successful
Build (backend build only) / build (push) Successful in 3m18s
Build and Deploy Go App / build (push) Successful in 8m32s
Build and Deploy Go App / deploy (push) Successful in 27s

This commit is contained in:
Iron_Felix 2025-12-20 01:16:26 +03:00
parent c58b578023
commit 4fe077d229
3 changed files with 55 additions and 29 deletions

View file

@ -102,6 +102,19 @@ func (q *Queries) GetImageByID(ctx context.Context, illustID int64) (Image, erro
return i, err
}
const getImageByPath = `-- name: GetImageByPath :one
SELECT id, storage_type, image_path
FROM images
WHERE image_path = $1::text
`
func (q *Queries) GetImageByPath(ctx context.Context, illustPath string) (Image, error) {
row := q.db.QueryRow(ctx, getImageByPath, illustPath)
var i Image
err := row.Scan(&i.ID, &i.StorageType, &i.ImagePath)
return i, err
}
const getReviewByID = `-- name: GetReviewByID :one
SELECT id, data, rating, user_id, title_id, created_at