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

@@ -5,15 +5,16 @@ import { RefObject } from "react";
export const pwd_key_config = "fchgvjknlmdfnbvghhujlaknsdvjbhknlkmsdbdyu567t8y9u30r4587638y9uipkoeghjvuyi89ipkoefmnrjbhtiu4or9ipkoemnjfbhjiuoijdklnjhbviufojkejnshbiuojijknehgruyu"
export const globalRole = hookstate<string>('')
export const DIR = {
parentDir: "cm0x8a1as0001bp5te7354yrp",
task: "cm0xhcqf0000dacbbixjb09yn",
project: "cm0xhc9sv000bacbb7rfikw1k",
document: "cm0xhbkf50009acbbtw03qo4l",
village: "cm0xhb91o0007acbbkx8rk8hj",
user: "cm0x8dbwn0005bp5tgmfcthzw",
banner: "cm1sxex19004938bjvyaq8vta"
}
export const keyWibu= 'padahariminggukuturutayahkekotanaikdelmanistimewakududukdimuka'
export const keyWibu = 'padahariminggukuturutayahkekotanaikdelmanistimewakududukdimuka'
export const TEMA = hookstate<IGlobalTema>({
utama: "#19345E",

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: {} }
}
}

View File

@@ -25,6 +25,7 @@ import NotificationCustome from "./components/notification_custome";
import { ScrollProvider } from "./components/scroll_provider";
import SkeletonUser from "./components/skeleton_user";
import SkeletonList from "./components/skeleton_list";
import { funViewDir } from "./fun/view_dir";
export { WARNA };
export { LayoutLogin };
@@ -59,3 +60,4 @@ export { currentScroll }
export { SkeletonUser }
export { SkeletonList }
export { keyWibu }
export { funViewDir }