diff --git a/src/components/management/StuffDetail.jsx b/src/components/management/StuffDetail.jsx index 0c825c20..5915fb38 100644 --- a/src/components/management/StuffDetail.jsx +++ b/src/components/management/StuffDetail.jsx @@ -3,7 +3,7 @@ import { useState, useEffect, useRef, useContext } from 'react' import { useRouter, useSearchParams } from 'next/navigation' import { Button } from '@nextui-org/react' -import Select, { components } from 'react-select' +import Select from 'react-select' import { useAxios } from '@/hooks/useAxios' import { globalLocaleStore } from '@/store/localeAtom' import { isEmptyArray, isNotEmptyArray, isObjectNotEmpty, queryStringFormatter } from '@/util/common-utils' @@ -1404,6 +1404,11 @@ export default function StuffDetail() { }) .catch((error) => { setIsGlobalLoading(false) + swalFire({ + text: error?.response?.data?.message, + type: 'alert', + icon: 'error', + }) console.log('error::::::', error) }) } else { @@ -1432,6 +1437,11 @@ export default function StuffDetail() { }) .catch((error) => { setIsGlobalLoading(false) + swalFire({ + text: error?.response?.data?.message, + type: 'alert', + icon: 'error', + }) console.log('error::::::', error) }) } @@ -1523,6 +1533,11 @@ export default function StuffDetail() { }) .catch((error) => { setIsGlobalLoading(false) + swalFire({ + text: error?.response?.data?.message, + type: 'alert', + icon: 'error', + }) console.log('error::::::', error) }) } else { @@ -1542,6 +1557,11 @@ export default function StuffDetail() { }) .catch((error) => { setIsGlobalLoading(false) + swalFire({ + text: error?.response?.data?.message, + type: 'alert', + icon: 'error', + }) console.log('error::::::', error) }) } @@ -1606,8 +1626,13 @@ export default function StuffDetail() { router.push('/management/stuff', { scroll: false }) }) .catch((error) => { - console.log('error::::::', error) setIsGlobalLoading(false) + swalFire({ + text: error?.response?.data?.message, + type: 'alert', + icon: 'error', + }) + console.log('error::::::', error) }) }, }) @@ -1691,15 +1716,12 @@ export default function StuffDetail() { {getMessage('stuff.detail.required')}