upd: project

Deskripsi:
- upload file pada project

No Issues
This commit is contained in:
amel
2024-09-02 14:39:52 +08:00
parent 65b3d61b49
commit 9ee3e0a2ff
6 changed files with 62 additions and 49 deletions

View File

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