fix
All checks were successful
Build and Deploy Go App / build (push) Successful in 17m41s
Build and Deploy Go App / deploy (push) Successful in 3m34s

This commit is contained in:
Iron_Felix 2025-11-18 04:19:34 +03:00
parent 8371121130
commit 8deba7afd9
4 changed files with 28 additions and 7 deletions

View file

@ -87,7 +87,7 @@ func (s Server) GetImage(ctx context.Context, id int64) (*oapi.Image, error) {
sqlc_image, err := s.db.GetImageByID(ctx, id)
if err != nil {
if err == pgx.ErrNoRows {
return nil, nil
return nil, nil //todo: error reference in db
}
return &oapi_image, fmt.Errorf("query GetImageByID: %v", err)
}
@ -217,7 +217,7 @@ func (s Server) GetTitleTitleId(ctx context.Context, request oapi.GetTitleTitleI
}
func (s Server) GetTitle(ctx context.Context, request oapi.GetTitleRequestObject) (oapi.GetTitleResponseObject, error) {
opai_titles := make([]oapi.Title, 1)
opai_titles := make([]oapi.Title, 0)
word := Word2Sqlc(request.Params.Word)
status, err := TitleStatus2Sqlc(request.Params.Status)

View file

@ -1,7 +1,7 @@
-- name: GetImageByID :one
SELECT id, storage_type, image_path
FROM images
WHERE id = sqlc.arg('illust_id');
WHERE id = sqlc.arg('illust_id')::bigint;
-- name: CreateImage :one
INSERT INTO images (storage_type, image_path)