use fetchWrapper to create tasks

This commit is contained in:
T'JAMPENS QUENTIN p2406187
2026-01-28 14:19:43 +01:00
parent dcdc4e7ac4
commit aef3c1efbc
2 changed files with 17 additions and 37 deletions
@@ -20,7 +20,7 @@ export default function CreateTaskBtn({ id }) {
const { updateEventInfo } = useContext(EventDetailContext)
const createTask = async () => {
const success = await createTaskApi({
const data = await createTaskApi({
eventId: id,
name: taskName,
description: taskDescription,
@@ -30,7 +30,7 @@ export default function CreateTaskBtn({ id }) {
maxParticipants,
});
if (success) {
if (data?.status === 200) {
setOpenTaskModal(false);
setTaskName("");
setTaskDescription("");