upd: tambah task divisi

Deskripsi:
- tambah dropzone
- update struktur database

- create task

No Issuess
This commit is contained in:
amel
2024-08-16 15:55:09 +08:00
parent 9b0450c75e
commit ed12cc087a
12 changed files with 368 additions and 81 deletions

View File

@@ -1,4 +1,21 @@
import { IFormTaskDivision } from "./type_task";
export const funGetAllTask = async (path?: string) => {
const response = await fetch(`/api/task${(path) ? path : ''}`, { next: { tags: ['task'] } });
return await response.json().catch(() => null);
}
}
export const funCreateTask = async (data: IFormTaskDivision) => {
if (data.title.length < 3)
return { success: false, message: 'Nama proyek minimal 3 karakter' }
const response = await fetch("/api/task", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(data),
});
return await response.json().catch(() => null);
};