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

@@ -32,6 +32,7 @@ export function ComponentKatalog_ButtonHeaderRight({
opened={opened}
close={() => close()}
profileId={profileId}
userId={userLoginId}
/>
</>
);

View File

@@ -4,7 +4,7 @@ import {
} from "@/app/lib/router_hipmi/router_katalog";
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
import Component_Logout from "@/app_modules/auth/logout/view";
import Component_ButtonLogout from "@/app_modules/auth/logout/view";
import {
ActionIcon,
Drawer,
@@ -27,10 +27,12 @@ export function ComponentKatalog_DrawerKatalog({
opened,
close,
profileId,
userId
}: {
opened: boolean;
close: () => void;
profileId: string;
userId: string
}) {
const router = useRouter();
const [pageId, setPageId] = useState("");
@@ -121,7 +123,8 @@ export function ComponentKatalog_DrawerKatalog({
</Text>
</Stack>
))}
<Component_Logout />
<Component_ButtonLogout userId={userId} />
</SimpleGrid>
</Stack>
</Drawer>

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);
}
}