upd: kegiatan atau project

Deskripsi:
- hapus file dan tambah file

NO Issues
This commit is contained in:
amel
2024-09-02 15:34:51 +08:00
parent 9ee3e0a2ff
commit 132227ae80
13 changed files with 553 additions and 16 deletions

View File

@@ -120,4 +120,31 @@ export const funEditProject = async (path: string, data: { name: string }) => {
body: JSON.stringify(data),
});
return await response.json().catch(() => null);
}
}
export const funDeleteFileProject = async (path: string) => {
const response = await fetch(`/api/project/file/${path}`, {
method: "DELETE",
headers: {
"Content-Type": "application/json",
},
});
return await response.json().catch(() => null);
};
export const funCekNamFileUploadProject = async (path: string, data: FormData) => {
const response = await fetch(`/api/project/file/${path}`, {
method: "PUT",
body: data,
});
return await response.json().catch(() => null);
};
export const funAddFileProject = async (path: string, data: FormData) => {
const response = await fetch(`/api/project/file/${path}`, {
method: "POST",
body: data,
});
return await response.json().catch(() => null);
};