Finish code base

This commit is contained in:
AndrewTrieu
2023-03-12 17:29:07 +02:00
parent b3065cfce1
commit 7089f460a4
8 changed files with 22 additions and 14 deletions

View File

@@ -15,8 +15,7 @@ const addAnswer = async (questionId, optionText, isCorrect) => {
await sql`INSERT INTO question_answer_options (question_id, option_text, is_correct) VALUES (${questionId}, ${optionText}, ${isCorrect})`;
};
const deleteAnswer = async (questionId, optionId) => {
await sql`DELETE FROM question_answer_options WHERE question_id = ${questionId} AND id = ${optionId}`;
const deleteAnswer = async (optionId) => {
await sql`DELETE FROM question_answer_options WHERE id = ${optionId}`;
};