add GetQidOwner query

This commit is contained in:
Pavel 2024-03-22 14:31:37 +03:00
parent 88a0fe7e58
commit 33e5180c5f
2 changed files with 12 additions and 0 deletions

@ -608,3 +608,6 @@ FROM
question
WHERE
question.quiz_id = $1 AND deleted = false;
-- name: GetQidOwner :one
SELECT accountid FROM quiz where qid=$1;

@ -307,3 +307,12 @@ func (r *AccountRepository) GetAccAndPrivilegeByEmail(ctx context.Context, email
return account, privileges, nil
}
func (r *AccountRepository) GetQidOwner(ctx context.Context, qId string) (string, error) {
userID, err := r.queries.GetQidOwner(ctx)
if err != nil {
return "", err
}
return userID, nil
}