feat: add form response submition endpoint and forms filtering
Docker Build and Push / Build and Push Docker Image (push) Successful in 13m18s
Docker Build and Push / Build and Push Docker Image (push) Successful in 13m18s
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
-- name: CreateFormResponse :one
|
||||
INSERT INTO form_responses (form_id, user_id)
|
||||
VALUES ($1, $2)
|
||||
RETURNING *;
|
||||
|
||||
-- name: GetFormResponsesByFormID :many
|
||||
SELECT * FROM form_responses
|
||||
WHERE form_id = $1
|
||||
ORDER BY submitted_at DESC;
|
||||
|
||||
-- name: FormHasResponses :one
|
||||
SELECT EXISTS (
|
||||
SELECT 1 FROM form_responses WHERE form_id = $1
|
||||
) AS has_responses;
|
||||
|
||||
-- name: CreateResponseAnswer :one
|
||||
INSERT INTO response_answers (response_id, question_id, form_id, answer_text)
|
||||
VALUES ($1, $2, $3, $4)
|
||||
RETURNING *;
|
||||
|
||||
-- name: GetAnswersByResponseID :many
|
||||
SELECT * FROM response_answers
|
||||
WHERE response_id = $1
|
||||
ORDER BY id ASC;
|
||||
Reference in New Issue
Block a user