upd: tambah anggota task
Deskripsi: -tambah anggota task NO ISsues
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { IFormAddDetailTask, IFormDateTask, IFormTaskDivision } from "./type_task";
|
||||
import { IFormAddDetailTask, IFormAddMemberTask, IFormDateTask, IFormTaskDivision } from "./type_task";
|
||||
|
||||
export const funGetAllTask = async (path?: string) => {
|
||||
const response = await fetch(`/api/task${(path) ? path : ''}`, { next: { tags: ['task'] } });
|
||||
@@ -76,4 +76,15 @@ export const funCreateDetailTask = async (path: string, data: IFormAddDetailTask
|
||||
body: JSON.stringify(data),
|
||||
});
|
||||
return await response.json().catch(() => null);
|
||||
};
|
||||
|
||||
export const funAddMemberTask = async (path: string, data: IFormAddMemberTask) => {
|
||||
const response = await fetch(`/api/task/${path}/member`, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(data),
|
||||
});
|
||||
return await response.json().catch(() => null);
|
||||
};
|
||||
Reference in New Issue
Block a user