@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/CHANGELOG.md +6 -0
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -2970,10 +2970,12 @@ function useUserRepo() {
|
|
|
2970
2970
|
async function updateUserFieldById({ _id, field, value } = {}, session) {
|
|
2971
2971
|
const allowedFields = [
|
|
2972
2972
|
"name",
|
|
2973
|
-
"gender",
|
|
2974
2973
|
"email",
|
|
2975
2974
|
"contact",
|
|
2975
|
+
"nric",
|
|
2976
|
+
"dateOfBirth",
|
|
2976
2977
|
"profile",
|
|
2978
|
+
"gender",
|
|
2977
2979
|
"defaultOrg"
|
|
2978
2980
|
];
|
|
2979
2981
|
if (!allowedFields.includes(field)) {
|
|
@@ -6690,7 +6692,7 @@ function useUserController() {
|
|
|
6690
6692
|
async function updateUserFieldById(req, res, next) {
|
|
6691
6693
|
const validation = import_joi13.default.object({
|
|
6692
6694
|
_id: import_joi13.default.string().hex().required(),
|
|
6693
|
-
field: import_joi13.default.string().valid("name", "
|
|
6695
|
+
field: import_joi13.default.string().valid("name", "email", "contact", "nric", "dateOfBirth", "profile", "gender", "defaultOrg").required(),
|
|
6694
6696
|
value: import_joi13.default.when("field", {
|
|
6695
6697
|
switch: [
|
|
6696
6698
|
{ is: "email", then: import_joi13.default.string().email().required() },
|
|
@@ -34063,7 +34065,7 @@ function useOccurrenceBookRepo() {
|
|
|
34063
34065
|
throw new import_node_server_utils156.BadRequestError("Invalid date format. Use DD/MM/YYYY.");
|
|
34064
34066
|
if (day > 31 || month > 12)
|
|
34065
34067
|
throw new import_node_server_utils156.BadRequestError("Invalid date value.");
|
|
34066
|
-
dateObj = new Date(Date.UTC(year, month - 1, day));
|
|
34068
|
+
dateObj = new Date(Date.UTC(year, month - 1, day - 1));
|
|
34067
34069
|
} else {
|
|
34068
34070
|
dateObj = new Date(date);
|
|
34069
34071
|
}
|