@appcorp/fusion-storybook 0.4.50 → 0.4.52

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.
@@ -78,7 +78,7 @@ export const { actionTypes: ATTENDANCE_ACTION_TYPES, config: attendanceModuleCon
78
78
  // 1.4 ENHANCED ATTENDANCE HOOK WITH API INTEGRATION
79
79
  // ============================================================================
80
80
  export const useAttendanceModule = () => {
81
- var _a;
81
+ var _a, _b;
82
82
  const context = useAttendanceContext();
83
83
  const { dispatch } = context;
84
84
  const state = context.state;
@@ -276,11 +276,12 @@ export const useAttendanceModule = () => {
276
276
  });
277
277
  }, [dispatch]);
278
278
  const handleSearch = useCallback((query) => {
279
+ var _a;
279
280
  dispatch({
280
281
  type: ATTENDANCE_ACTION_TYPES.SET_SEARCH_QUERY,
281
- payload: { searchQuery: query },
282
+ payload: { searchQuery: query, schoolId: ((_a = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _a === void 0 ? void 0 : _a.id) || "" },
282
283
  });
283
- }, [dispatch]);
284
+ }, [dispatch, (_b = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _b === void 0 ? void 0 : _b.id]);
284
285
  const clearFilters = useCallback(() => {
285
286
  dispatch({
286
287
  type: ATTENDANCE_ACTION_TYPES.RESET_FORM,
@@ -22,7 +22,7 @@ import { useTranslations } from "next-intl";
22
22
  import { useFetch } from "@react-pakistan/util-functions/hooks/use-fetch";
23
23
  import { getTranslatedError } from "../../utils/get-translated-error";
24
24
  export const StudentFeeForm = () => {
25
- var _a, _b, _c, _d, _e;
25
+ var _a, _b, _c, _d, _e, _f, _g, _h;
26
26
  const { state, handleChange } = useStudentFeeModule();
27
27
  const { amount, amountDue, amountPaid, discountAmount, discountCodeId, drawer, dueDate, enabled, errors, feeStructureId, paidAt, remarks, status, studentProfileId, } = state;
28
28
  const workspace = getCachedWorkspaceSync();
@@ -37,15 +37,15 @@ export const StudentFeeForm = () => {
37
37
  REFUNDED: t("formOptionRefunded"),
38
38
  };
39
39
  const { fetchNow: studentProfileFetchNow, data: studentProfiles } = useFetch("/api/v1/student-profile", {
40
- params: { workspaceId: workspace === null || workspace === void 0 ? void 0 : workspace.id },
40
+ params: { schoolId: (_c = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _c === void 0 ? void 0 : _c.id },
41
41
  method: API_METHODS.GET,
42
42
  });
43
43
  const { fetchNow: feeStructureFetchNow, data: feeStructures } = useFetch("/api/v1/fee-structure", {
44
- params: { workspaceId: workspace === null || workspace === void 0 ? void 0 : workspace.id },
44
+ params: { schoolId: (_d = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _d === void 0 ? void 0 : _d.id },
45
45
  method: API_METHODS.GET,
46
46
  });
47
47
  const { fetchNow: discountCodeFetchNow, data: discountCodes } = useFetch("/api/v1/discount-code", {
48
- params: { workspaceId: workspace === null || workspace === void 0 ? void 0 : workspace.id },
48
+ params: { schoolId: (_e = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _e === void 0 ? void 0 : _e.id },
49
49
  method: API_METHODS.GET,
50
50
  });
51
51
  useEffect(() => {
@@ -62,7 +62,7 @@ export const StudentFeeForm = () => {
62
62
  info: t("formStudentInfo"),
63
63
  label: t("formStudentLabel"),
64
64
  onValueChange: (value) => handleChange("studentProfileId", value),
65
- options: (_c = studentProfiles === null || studentProfiles === void 0 ? void 0 : studentProfiles.items) === null || _c === void 0 ? void 0 : _c.map((s) => {
65
+ options: (_f = studentProfiles === null || studentProfiles === void 0 ? void 0 : studentProfiles.items) === null || _f === void 0 ? void 0 : _f.map((s) => {
66
66
  var _a, _b;
67
67
  return ({
68
68
  value: s.id,
@@ -92,7 +92,7 @@ export const StudentFeeForm = () => {
92
92
  info: t("formFeeStructureInfo"),
93
93
  label: t("formFeeStructureLabel"),
94
94
  onValueChange: (value) => handleChange("feeStructureId", value),
95
- options: (_d = feeStructures === null || feeStructures === void 0 ? void 0 : feeStructures.items) === null || _d === void 0 ? void 0 : _d.map((fs) => ({
95
+ options: (_g = feeStructures === null || feeStructures === void 0 ? void 0 : feeStructures.items) === null || _g === void 0 ? void 0 : _g.map((fs) => ({
96
96
  value: fs.id,
97
97
  label: fs.name,
98
98
  })),
@@ -115,7 +115,7 @@ export const StudentFeeForm = () => {
115
115
  info: t("formDiscountCodeInfo"),
116
116
  label: t("formDiscountCodeLabel"),
117
117
  onValueChange: (value) => handleChange("discountCodeId", value),
118
- options: ((_e = discountCodes === null || discountCodes === void 0 ? void 0 : discountCodes.items) === null || _e === void 0 ? void 0 : _e.map((code) => ({
118
+ options: ((_h = discountCodes === null || discountCodes === void 0 ? void 0 : discountCodes.items) === null || _h === void 0 ? void 0 : _h.map((code) => ({
119
119
  value: code.id,
120
120
  label: `${code.code} - ${code.discountValue}${code.discountType === DISCOUNT_TYPE.PERCENTAGE ? "%" : currency}`,
121
121
  }))) || [],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appcorp/fusion-storybook",
3
- "version": "0.4.50",
3
+ "version": "0.4.52",
4
4
  "scripts": {
5
5
  "build-storybook": "storybook build",
6
6
  "build:next": "next build",