Bổ sung check lỗi không có quyền khi xóa nôte

This commit is contained in:
Truong Vo 2024-08-09 15:16:07 +07:00
parent 4744ac3e23
commit 072d8ccad7
1 changed files with 10 additions and 3 deletions

View File

@ -135,6 +135,13 @@ export const Xdelete = async (url: string, data: any, fnc?: () => void) => {
return res.status
} catch (error: any) {
console.log(error)
if (error?.status == false) {
notifications.show({
title: 'Error',
message: error.message ?? _NOTIFICATION_MESS.delete_error,
color: 'red',
})
}
if (error.response.status === 422) {
const errorMess = error.response.data.message
notifications.show({