upd: be banner

Deskripsi:
- database table banner
- api crud banner

No
Issues
This commit is contained in:
amel
2024-10-03 17:18:13 +08:00
parent 3b5d98ad27
commit 1645803e36
7 changed files with 227 additions and 2 deletions

View File

@@ -0,0 +1,22 @@
export async function funViewDir({ dirId }: { dirId: string }) {
try {
const res = await fetch("https://wibu-storage.wibudev.com/api/dir/" + dirId + "/tree", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.WS_APIKEY}`
}
});
if (res.ok) {
const hasil = await res.json()
return { success: true, data: hasil.data }
} else {
const errorText = await res.text();
return { success: false, data: {} }
}
} catch (error) {
console.error("Upload error:", error);
return { success: false, data: {} }
}
}