Fix: Investasi

Deskripsi:
- Upload gambar investasi ke storage wibu
- Upload bukti transfer ke storage wibu
# No Issue
This commit is contained in:
2024-10-15 11:06:14 +08:00
parent 3d6ec1410d
commit 5ff74b00f5
121 changed files with 4022 additions and 1139 deletions

View File

@@ -0,0 +1,24 @@
export async function funGlobal_DeleteFileById({ fileId }: { fileId: string }) {
try {
const res = await fetch(
`https://wibu-storage.wibudev.com/api/files/${fileId}/delete`,
{
method: "DELETE",
headers: {
Authorization: `Bearer ${process.env.WS_APIKEY}`,
},
}
);
if (res.ok) {
const hasil = await res.json();
return { success: true };
} else {
const errorText = await res.json();
return { success: false };
}
} catch (error) {
return { success: false };
console.error("Upload error:", error);
}
}

View File

@@ -1,3 +1,5 @@
import { funGlobal_DeleteFileById } from "./delete/fun_delete_file_by_id";
import { funGlobal_UploadToStorage } from "./upload/fun_upload_to_storage";
export { funGlobal_UploadToStorage };
export { funGlobal_DeleteFileById };