@rkosafo/cai.components 0.0.39 → 0.0.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
Select,
|
|
25
25
|
Table,
|
|
26
26
|
TableLoader,
|
|
27
|
+
toast,
|
|
27
28
|
type DatatableProps,
|
|
28
29
|
type IFormChangeProp,
|
|
29
30
|
type TableFilter
|
|
@@ -136,6 +137,7 @@
|
|
|
136
137
|
});
|
|
137
138
|
if (!ret?.success) {
|
|
138
139
|
// showError(ret?.message || 'Failed to load data');
|
|
140
|
+
toast.error(ret?.message || 'Failed to load data');
|
|
139
141
|
return true;
|
|
140
142
|
}
|
|
141
143
|
const xs = ret.data;
|
|
@@ -145,7 +147,7 @@
|
|
|
145
147
|
pageInfo.setHasPrevPage(xs.pageInfo.hasPreviousPage);
|
|
146
148
|
tableData = xs.items;
|
|
147
149
|
} catch (e: any) {
|
|
148
|
-
|
|
150
|
+
toast.error(e.message || e);
|
|
149
151
|
} finally {
|
|
150
152
|
busy = false;
|
|
151
153
|
}
|
|
@@ -285,7 +287,7 @@
|
|
|
285
287
|
? 'Successfully updated record'
|
|
286
288
|
: 'Successfully added record'
|
|
287
289
|
: '';
|
|
288
|
-
|
|
290
|
+
toast.success(ret.message || successMessage);
|
|
289
291
|
allowLoadAfterCreate && (await fetchData(pageNumber, { search: query }));
|
|
290
292
|
|
|
291
293
|
allowDispatchAfterAction &&
|
|
@@ -296,10 +298,10 @@
|
|
|
296
298
|
activeEntry = {};
|
|
297
299
|
closeSideModal();
|
|
298
300
|
} else {
|
|
299
|
-
|
|
301
|
+
toast.error(ret?.message || 'Failed');
|
|
300
302
|
}
|
|
301
|
-
} catch (error) {
|
|
302
|
-
|
|
303
|
+
} catch (error: any) {
|
|
304
|
+
toast.error(error?.message || 'failed');
|
|
303
305
|
} finally {
|
|
304
306
|
isLoading = false;
|
|
305
307
|
}
|
|
@@ -316,14 +318,14 @@
|
|
|
316
318
|
deleteLoading = true;
|
|
317
319
|
const ret = await deleteEntry(id);
|
|
318
320
|
if (!ret?.success) {
|
|
319
|
-
|
|
321
|
+
toast.error(ret?.message || 'Failed to delete');
|
|
320
322
|
return;
|
|
321
323
|
}
|
|
322
|
-
|
|
324
|
+
toast.success(ret.message);
|
|
323
325
|
closeAlert();
|
|
324
326
|
await fetchData(pageNumber, { search: query });
|
|
325
327
|
} catch (error: any) {
|
|
326
|
-
|
|
328
|
+
toast.error(error?.message || error);
|
|
327
329
|
} finally {
|
|
328
330
|
deleteLoading = false;
|
|
329
331
|
}
|