use fetchWrapper to create tasks
This commit is contained in:
@@ -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("");
|
||||
|
||||
Reference in New Issue
Block a user