upd: toast alert

This commit is contained in:
2026-02-24 17:44:49 +08:00
parent 214a243e44
commit 8c6ff06216
67 changed files with 384 additions and 187 deletions

View File

@@ -44,8 +44,11 @@ export default function HeaderRightProjectDetail({ id, status }: Props) {
} else {
Toast.show({ type: 'small', text1: 'Gagal menghapus kegiatan', })
}
} catch (error) {
} catch (error :any ) {
console.error(error)
const message = error?.response?.data?.message || "Gagal menghapus kegiatan"
Toast.show({ type: 'small', text1: message })
} finally {
setVisible(false)
}
@@ -61,8 +64,11 @@ export default function HeaderRightProjectDetail({ id, status }: Props) {
} else {
Toast.show({ type: 'small', text1: 'Gagal menambahkan link', })
}
} catch (error) {
} catch (error :any ) {
console.error(error)
const message = error?.response?.data?.message || "Gagal menambahkan link"
Toast.show({ type: 'small', text1: message })
} finally {
setAddLink(false)
}

View File

@@ -86,9 +86,11 @@ export default function SectionFile({ status, member, refreshing }: { status: nu
} else {
Toast.show({ type: 'small', text1: response.message, })
}
} catch (error) {
} catch (error : any ) {
console.error(error);
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
const message = error?.response?.data?.message || "Gagal menghapus file"
Toast.show({ type: 'small', text1: message })
} finally {
setModal(false)
}

View File

@@ -68,9 +68,11 @@ export default function SectionLink({ status, member, refreshing }: { status: nu
} else {
Toast.show({ type: 'small', text1: response.message, })
}
} catch (error) {
} catch (error : any ) {
console.error(error);
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
const message = error?.response?.data?.message || "Gagal menghapus link"
Toast.show({ type: 'small', text1: message })
} finally {
setModal(false)
}

View File

@@ -88,8 +88,11 @@ export default function SectionMember({ status, refreshing }: { status: number |
dispatch(setUpdateProject({ ...update, member: !update.member }))
setModal(false);
}
} catch (error) {
} catch (error : any ) {
console.error(error);
const message = error?.response?.data?.message || "Gagal menghapus anggota"
Toast.show({ type: 'small', text1: message })
}
}

View File

@@ -91,8 +91,11 @@ export default function SectionTanggalTugasProject({ status, member, refreshing
setSelect(false);
Toast.show({ type: 'small', text1: 'Berhasil mengubah data', })
}
} catch (error) {
} catch (error : any ) {
console.error(error);
const message = error?.response?.data?.message || "Gagal mengubah data"
Toast.show({ type: 'small', text1: message })
}
}
@@ -108,8 +111,11 @@ export default function SectionTanggalTugasProject({ status, member, refreshing
setModal(false);
Toast.show({ type: 'small', text1: 'Berhasil menghapus data', })
}
} catch (error) {
} catch (error : any ) {
console.error(error);
const message = error?.response?.data?.message || "Gagal menghapus data"
Toast.show({ type: 'small', text1: message })
}
}