feat: Implemented create wish method for wish list service
This commit is contained in:
@@ -1054,6 +1054,28 @@ func (q *Queries) GetWishByGuid(ctx context.Context, guid string) (Wish, error)
|
||||
return i, err
|
||||
}
|
||||
|
||||
const getWishListOwnerByGuid = `-- name: GetWishListOwnerByGuid :one
|
||||
SELECT u.id, u.username, u.verified, u.registration_date, u.role, u.deleted
|
||||
FROM wish_lists wl
|
||||
JOIN profiles p ON wl.profile_id = p.id
|
||||
JOIN users u ON p.user_id = u.id
|
||||
WHERE wl.guid = ($1::text)::uuid
|
||||
`
|
||||
|
||||
func (q *Queries) GetWishListOwnerByGuid(ctx context.Context, guid string) (User, error) {
|
||||
row := q.db.QueryRow(ctx, getWishListOwnerByGuid, guid)
|
||||
var i User
|
||||
err := row.Scan(
|
||||
&i.ID,
|
||||
&i.Username,
|
||||
&i.Verified,
|
||||
&i.RegistrationDate,
|
||||
&i.Role,
|
||||
&i.Deleted,
|
||||
)
|
||||
return i, err
|
||||
}
|
||||
|
||||
const getWishlistByGuid = `-- name: GetWishlistByGuid :one
|
||||
SELECT id, guid, profile_id, hidden, name, icon_name, color, color_grad, deleted FROM wish_lists wl
|
||||
WHERE wl.guid = ($1::text)::uuid
|
||||
|
||||
Reference in New Issue
Block a user