@7365admin1/core 3.32.2-staging.102 → 3.32.2-staging.103

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.
package/dist/index.d.ts CHANGED
@@ -9094,6 +9094,7 @@ declare function MFormEntry(value: TFormEntry): {
9094
9094
  deletedAt: Date | null;
9095
9095
  };
9096
9096
  interface residentFormEntry {
9097
+ formType?: string;
9097
9098
  typeOfForm: string;
9098
9099
  unitNumber: string;
9099
9100
  status: string;
package/dist/index.js CHANGED
@@ -80291,6 +80291,10 @@ function MFormEntry(value) {
80291
80291
  }
80292
80292
  var residentFormEntry = import_joi156.default.object({
80293
80293
  _id: import_joi156.default.string().hex().optional().allow("", null),
80294
+ // The same PUT /form-entries/id/:id endpoint is also used to edit an
80295
+ // online form's own template config (admin builder), which sends
80296
+ // `formType` rather than `typeOfForm` — allow both.
80297
+ formType: import_joi156.default.string().optional().allow("", null),
80294
80298
  typeOfForm: import_joi156.default.string().optional().allow("", null),
80295
80299
  unitNumber: import_joi156.default.string().optional().allow(null, ""),
80296
80300
  fields: import_joi156.default.object().pattern(
@@ -80449,17 +80453,17 @@ function useFormEntryRepo() {
80449
80453
  if (!onlineFormRequest) {
80450
80454
  throw new import_node_server_utils275.NotFoundError("Online form not found.");
80451
80455
  }
80452
- const user = await getUserById(onlineFormRequest.userId.toString());
80453
- if (!user || !user._id) {
80454
- throw new import_node_server_utils275.NotFoundError("User not found.");
80456
+ if (onlineFormRequest.userId) {
80457
+ const user = await getUserById(onlineFormRequest.userId.toString());
80458
+ if (user?._id) {
80459
+ await NotificationService.onlineFormRequestStatusUpdated({
80460
+ to: user._id.toString(),
80461
+ onlineFormId: onlineFormRequest._id,
80462
+ status: onlineFormRequest.status,
80463
+ siteId: onlineFormRequest.site
80464
+ });
80465
+ }
80455
80466
  }
80456
- const userId = user._id.toString();
80457
- await NotificationService.onlineFormRequestStatusUpdated({
80458
- to: userId,
80459
- onlineFormId: onlineFormRequest._id,
80460
- status: onlineFormRequest.status,
80461
- siteId: onlineFormRequest.site
80462
- });
80463
80467
  return res.modifiedCount;
80464
80468
  } catch (error) {
80465
80469
  throw error;