Button Loading Collab, Voting & Investasi

This commit is contained in:
2025-01-09 17:47:55 +08:00
parent d0716bd859
commit 6aac009155
9 changed files with 170 additions and 76 deletions

View File

@@ -195,13 +195,21 @@ function ButtonAction({ value }: { value: any }) {
return ComponentGlobal_NotifikasiPeringatan("Pilih Industri");
const res = await colab_funCreateProyek(value);
if (res.status === 201) {
setLoading(true);
router.back();
ComponentGlobal_NotifikasiBerhasil(res.message);
} else {
ComponentGlobal_NotifikasiGagal(res.message);
try {
setLoading(true)
if (res.status === 201) {
setLoading(true);
router.back();
ComponentGlobal_NotifikasiBerhasil(res.message);
} else {
setLoading(false)
ComponentGlobal_NotifikasiGagal(res.message);
}
} catch (error) {
setLoading(false)
clientLogger.error("Error create proyek", error);
}
}