@7365admin1/core 2.28.0 → 2.28.1

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.mjs CHANGED
@@ -2577,10 +2577,12 @@ function useUserRepo() {
2577
2577
  async function updateUserFieldById({ _id, field, value } = {}, session) {
2578
2578
  const allowedFields = [
2579
2579
  "name",
2580
- "gender",
2581
2580
  "email",
2582
2581
  "contact",
2582
+ "nric",
2583
+ "dateOfBirth",
2583
2584
  "profile",
2585
+ "gender",
2584
2586
  "defaultOrg"
2585
2587
  ];
2586
2588
  if (!allowedFields.includes(field)) {
@@ -6380,7 +6382,7 @@ function useUserController() {
6380
6382
  async function updateUserFieldById(req, res, next) {
6381
6383
  const validation = Joi13.object({
6382
6384
  _id: Joi13.string().hex().required(),
6383
- field: Joi13.string().valid("name", "gender", "email", "contact", "profile", "defaultOrg").required(),
6385
+ field: Joi13.string().valid("name", "email", "contact", "nric", "dateOfBirth", "profile", "gender", "defaultOrg").required(),
6384
6386
  value: Joi13.when("field", {
6385
6387
  switch: [
6386
6388
  { is: "email", then: Joi13.string().email().required() },
@@ -34141,7 +34143,7 @@ function useOccurrenceBookRepo() {
34141
34143
  throw new BadRequestError146("Invalid date format. Use DD/MM/YYYY.");
34142
34144
  if (day > 31 || month > 12)
34143
34145
  throw new BadRequestError146("Invalid date value.");
34144
- dateObj = new Date(Date.UTC(year, month - 1, day));
34146
+ dateObj = new Date(Date.UTC(year, month - 1, day - 1));
34145
34147
  } else {
34146
34148
  dateObj = new Date(date);
34147
34149
  }