upd: task divisi
Deskripsi: - cancel task - edit title task No Issues
This commit is contained in:
@@ -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);
|
||||
};
|
||||
Reference in New Issue
Block a user