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