upd: toast alert
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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 })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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 })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user