@appcorp/fusion-storybook 0.3.70 → 0.3.71
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.
|
@@ -31,7 +31,7 @@ export const useStudentFeeModule = () => {
|
|
|
31
31
|
// ============================================================================
|
|
32
32
|
// 1.4.1 STATE & CORE HOOKS
|
|
33
33
|
// ============================================================================
|
|
34
|
-
var _a, _b, _c, _d
|
|
34
|
+
var _a, _b, _c, _d;
|
|
35
35
|
const context = useStudentFeeContext();
|
|
36
36
|
const { dispatch } = context;
|
|
37
37
|
const state = context.state;
|
|
@@ -40,44 +40,39 @@ export const useStudentFeeModule = () => {
|
|
|
40
40
|
const workspace = getCachedWorkspaceSync();
|
|
41
41
|
const listFetchNowRef = useRef(null);
|
|
42
42
|
const debouncedQuery = useDebounce(state.searchQuery, 800);
|
|
43
|
+
const schoolId = ((_a = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _a === void 0 ? void 0 : _a.id) || "";
|
|
43
44
|
// ============================================================================
|
|
44
45
|
// 1.4.2 API PARAMETERS
|
|
45
46
|
// ============================================================================
|
|
46
|
-
const listParams = useMemo(() => {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
? { status: state.appliedFilterStatus }
|
|
52
|
-
: {})));
|
|
53
|
-
}, [
|
|
47
|
+
const listParams = useMemo(() => (Object.assign(Object.assign(Object.assign({ currentPage: state.currentPage, pageLimit: state.pageLimit, schoolId }, (debouncedQuery ? { searchQuery: debouncedQuery } : {})), (state.appliedFilterEnabled !== undefined
|
|
48
|
+
? { filterEnabled: String(state.appliedFilterEnabled) }
|
|
49
|
+
: {})), (state.appliedFilterStatus
|
|
50
|
+
? { status: state.appliedFilterStatus }
|
|
51
|
+
: {}))), [
|
|
54
52
|
state.appliedFilterEnabled,
|
|
55
53
|
state.appliedFilterStatus,
|
|
56
54
|
state.currentPage,
|
|
57
55
|
state.pageLimit,
|
|
58
56
|
debouncedQuery,
|
|
59
|
-
|
|
57
|
+
schoolId,
|
|
60
58
|
]);
|
|
61
|
-
const updateParams = useMemo(() => {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
studentProfileId: state.studentProfileId,
|
|
79
|
-
});
|
|
80
|
-
}, [state, (_b = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _b === void 0 ? void 0 : _b.id]);
|
|
59
|
+
const updateParams = useMemo(() => ({
|
|
60
|
+
amount: Number(state.amount),
|
|
61
|
+
amountDue: Number(state.amountDue),
|
|
62
|
+
amountPaid: Number(state.amountPaid),
|
|
63
|
+
discountAmount: Number(state.discountAmount),
|
|
64
|
+
discountCodeId: state.discountCodeId,
|
|
65
|
+
dueDate: state.dueDate,
|
|
66
|
+
enabled: state.enabled,
|
|
67
|
+
familyId: state.familyId,
|
|
68
|
+
feeStructureId: state.feeStructureId,
|
|
69
|
+
id: state.id,
|
|
70
|
+
paidAt: state.paidAt || null,
|
|
71
|
+
remarks: state.remarks || null,
|
|
72
|
+
schoolId,
|
|
73
|
+
status: state.status,
|
|
74
|
+
studentProfileId: state.studentProfileId,
|
|
75
|
+
}), [state, schoolId]);
|
|
81
76
|
const byIdParams = useMemo(() => ({ id: state.id }), [state.id]);
|
|
82
77
|
const deleteParams = useMemo(() => ({ id: state.id }), [state.id]);
|
|
83
78
|
// ============================================================================
|
|
@@ -148,7 +143,7 @@ export const useStudentFeeModule = () => {
|
|
|
148
143
|
},
|
|
149
144
|
},
|
|
150
145
|
});
|
|
151
|
-
}, [dispatch, workspace === null || workspace === void 0 ? void 0 : workspace.dueDateLength, (
|
|
146
|
+
}, [dispatch, workspace === null || workspace === void 0 ? void 0 : workspace.dueDateLength, (_b = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _b === void 0 ? void 0 : _b.id]);
|
|
152
147
|
// ============================================================================
|
|
153
148
|
// 1.4.4 API CALLBACKS
|
|
154
149
|
// ============================================================================
|
|
@@ -578,7 +573,7 @@ export const useStudentFeeModule = () => {
|
|
|
578
573
|
payload: { disabled: false },
|
|
579
574
|
});
|
|
580
575
|
}
|
|
581
|
-
}, [dispatch, showToast, t, (
|
|
576
|
+
}, [dispatch, showToast, t, (_c = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _c === void 0 ? void 0 : _c.id, resetFormAndCloseDrawer]);
|
|
582
577
|
const handleSubmit = useCallback(() => {
|
|
583
578
|
dispatch({
|
|
584
579
|
type: STUDENT_FEE_ACTION_TYPES.SET_DISABLE_SAVE_BUTTON,
|
|
@@ -643,7 +638,7 @@ export const useStudentFeeModule = () => {
|
|
|
643
638
|
payload: { disabled: false },
|
|
644
639
|
});
|
|
645
640
|
}
|
|
646
|
-
}, [dispatch, showToast, t, (
|
|
641
|
+
}, [dispatch, showToast, t, (_d = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _d === void 0 ? void 0 : _d.id, resetFormAndCloseDrawer]);
|
|
647
642
|
// ============================================================================
|
|
648
643
|
// 1.4.8 HEADER & ROW ACTIONS
|
|
649
644
|
// ============================================================================
|
|
@@ -695,11 +690,9 @@ export const useStudentFeeModule = () => {
|
|
|
695
690
|
listFetchNowRef.current = listFetchNow;
|
|
696
691
|
}, [listFetchNow]);
|
|
697
692
|
useEffect(() => {
|
|
698
|
-
var _a
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
(_b = listFetchNowRef.current) === null || _b === void 0 ? void 0 : _b.call(listFetchNowRef);
|
|
702
|
-
}, [dispatch, listParams, (_f = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _f === void 0 ? void 0 : _f.id, showToast, t]);
|
|
693
|
+
var _a;
|
|
694
|
+
(_a = listFetchNowRef.current) === null || _a === void 0 ? void 0 : _a.call(listFetchNowRef);
|
|
695
|
+
}, [listParams]);
|
|
703
696
|
// ============================================================================
|
|
704
697
|
// 1.4.10 RETURN
|
|
705
698
|
// ============================================================================
|