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,15 +178,21 @@ 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??? | ||||||
|         } |         } | ||||||
|         createQuestionMutation.mutate(questionData, { |         console.log(questionData) | ||||||
|             onSuccess: () => { |         if (questionInput.value != "") { | ||||||
|                 questionInput.value = "question:..."; // Clear the input field after submission |             createQuestionMutation.mutate(questionData, { | ||||||
|             }, |                 onSuccess: () => { | ||||||
|             onError: (e) => { |                     questionInput.value = "question:..."; // Clear the input field after submission | ||||||
|                 console.error(e) |                 }, | ||||||
|                 questionInput.value = ""; // Clear the input field after submission |                 onError: (e) => { | ||||||
|             }, |                     console.error(e) | ||||||
|         }) |                     questionInput.value = ""; // Clear the input field after submission | ||||||
|  |                 }, | ||||||
|  |             }) | ||||||
|  |         } else { | ||||||
|  |             alert("Please type a question before submitting.") | ||||||
|  |         } | ||||||
|  |          | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| </script> | </script> | ||||||
|  |  | ||||||
		Reference in a new issue
	
	 Timo De Meyst
						Timo De Meyst