feat: verplicht de gebruiker om een vraag te typen voordat hij submit
This commit is contained in:
parent
5c6e0b8554
commit
2b21cf4c53
1 changed files with 15 additions and 9 deletions
|
@ -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>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue