Removed all return error ro throw new err where this will be send to middleware.

This commit is contained in:
Owaise Imdad committed 2025-05-02 02:54:39 +05:30
1 parent 075559ffc3
commit 30ef28170c
2 files changed
+70 -73

No files matched your search

+1 -1
View File
@@ -16,7 +16,7 @@ export const useBulkMonitors = () => {
const response = await networkService.createBulkMonitors(formData);
return [true, response.data, null]; // [success, data, error]
} catch (err) {
const errorMessage = err?.response?.data?.errors?.[0]?.message || err.message;
const errorMessage = err?.response?.data?.msg || err.message;
return [false, null, errorMessage];
} finally {
setIsLoading(false);