feat: verplicht de gebruiker om een vraag te typen voordat hij submit

This commit is contained in:
Timo De Meyst 2025-04-24 15:42:09 +02:00
parent 5c6e0b8554
commit 2b21cf4c53

View file

@ -178,6 +178,8 @@ import type { GroupDTO } from "@dwengo-1/common/interfaces/group";
content: questionInput.value, content: questionInput.value,
inGroup: group //TODO: POST response zegt dat dit null is??? inGroup: group //TODO: POST response zegt dat dit null is???
} }
console.log(questionData)
if (questionInput.value != "") {
createQuestionMutation.mutate(questionData, { createQuestionMutation.mutate(questionData, {
onSuccess: () => { onSuccess: () => {
questionInput.value = "question:..."; // Clear the input field after submission questionInput.value = "question:..."; // Clear the input field after submission
@ -187,6 +189,10 @@ import type { GroupDTO } from "@dwengo-1/common/interfaces/group";
questionInput.value = ""; // Clear the input field after submission questionInput.value = ""; // Clear the input field after submission
}, },
}) })
} else {
alert("Please type a question before submitting.")
}
} }
</script> </script>