upd: task divisi

Deskripsi:
- cancel task
- edit title task

No Issues
This commit is contained in:
amel
2024-08-19 17:38:30 +08:00
parent 912f4fd309
commit a0155677f6
9 changed files with 378 additions and 4 deletions

View File

@@ -87,4 +87,29 @@ export const funAddMemberTask = async (path: string, data: IFormAddMemberTask) =
body: JSON.stringify(data),
});
return await response.json().catch(() => null);
};
export const funCancelTask = async (path: string, data: { reason: string }) => {
const response = await fetch(`/api/task/${path}`, {
method: "DELETE",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(data),
});
return await response.json().catch(() => null);
};
export const funEditTask = async (path: string, data: { title: string }) => {
const response = await fetch(`/api/task/${path}`, {
method: "PUT",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(data),
});
return await response.json().catch(() => null);
};