upd: task divisi

Deskripsi:
- tambah file

nb: blm selesai

No Issues
This commit is contained in:
amel
2024-08-30 17:17:29 +08:00
parent 2c89e30bbf
commit ed12f738bc
5 changed files with 115 additions and 69 deletions

View File

@@ -6,16 +6,11 @@ export const funGetAllTask = async (path?: string) => {
}
export const funCreateTask = async (data: IFormTaskDivision) => {
if (data.title.length < 3)
return { success: false, message: 'Nama Kegiatan minimal 3 karakter' }
export const funCreateTask = async (data: FormData) => {
const response = await fetch("/api/task", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(data),
body: data,
});
return await response.json().catch(() => null);
};