Fix: middleware

Deskripsi
- Fix middleware
- Fix metode login ( sekarang menggunakan api )
This commit is contained in:
2024-12-02 16:24:03 +08:00
parent 45279cd37f
commit 31124c5500
55 changed files with 1675 additions and 420 deletions

View File

@@ -47,21 +47,27 @@ export function Profile_ComponentCreateNewProfile({
"Lengkapi background profile"
);
setLoading(true);
const uploadPhoto = await funGlobal_UploadToStorage({
file: filePP,
dirId: DIRECTORY_ID.profile_foto,
});
if (!uploadPhoto.success)
if (!uploadPhoto.success) {
setLoading(false);
return ComponentGlobal_NotifikasiPeringatan("Gagal upload foto profile");
}
const uploadBackground = await funGlobal_UploadToStorage({
file: fileBG,
dirId: DIRECTORY_ID.profile_background,
});
if (!uploadBackground.success)
if (!uploadBackground.success) {
setLoading(false);
return ComponentGlobal_NotifikasiPeringatan(
"Gagal upload background profile"
);
}
const create = await funCreateNewProfile({
data: newData as any,
@@ -70,11 +76,11 @@ export function Profile_ComponentCreateNewProfile({
});
if (create.status === 201) {
setLoading(true);
ComponentGlobal_NotifikasiBerhasil("Berhasil membuat profile", 3000);
router.push(RouterHome.main_home, { scroll: false });
} else {
ComponentGlobal_NotifikasiGagal(create.message);
setLoading(false);
}
}