fix: streamline error handling in dialogs by removing unnecessary return statements
This commit is contained in:
@@ -46,7 +46,6 @@ export const FormCategoryPage = (properties: TProperties) => {
|
||||
useEffect(() => {
|
||||
if (!fetcher.data?.success && fetcher.data?.message) {
|
||||
toast.error(fetcher.data.message)
|
||||
return
|
||||
}
|
||||
|
||||
if (fetcher.data?.success) {
|
||||
@@ -54,7 +53,6 @@ export const FormCategoryPage = (properties: TProperties) => {
|
||||
`Kategori berhasil ${categoryData ? 'diupdate' : 'dibuat'}!`,
|
||||
)
|
||||
navigate('/lg-admin/categories')
|
||||
return
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [fetcher.data])
|
||||
|
||||
Reference in New Issue
Block a user