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