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

@@ -235,9 +235,11 @@ export default function DocumentDivision() {
} 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 mengubah nama"
Toast.show({ type: 'small', text1: message })
} finally {
setLoadingRename(false)
setRename(false)
@@ -258,9 +260,11 @@ export default function DocumentDivision() {
} 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"
Toast.show({ type: 'small', text1: message })
}
}
@@ -284,9 +288,11 @@ export default function DocumentDivision() {
} 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 membagikan"
Toast.show({ type: 'small', text1: message })
} finally {
setShare(false);
}