From b39e984fc2582c386abe21e3f06d389cf27a9af9 Mon Sep 17 00:00:00 2001 From: Rahul Date: Sat, 9 Sep 2023 18:40:14 +0530 Subject: [PATCH 1/2] [fixed] a spelling error in ./models/activityBlueprint.js line number 29 --- models/activityBlueprint.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/models/activityBlueprint.js b/models/activityBlueprint.js index 9750497..504e834 100644 --- a/models/activityBlueprint.js +++ b/models/activityBlueprint.js @@ -6,7 +6,7 @@ const activityBluePrintSchema = { type: String, required: true, validate: { - validator: (value) => /^20\d{2}$/.test(value), //changed the valid year format starting from "20" !! + validator: (value) => /^20\d{2}$/.test(value), // changed the valid year format starting from "20" !! message: (props) => `${props.value} is not a valid year format starting with "2"!`, }, }, @@ -26,12 +26,12 @@ async function remove(filter) { async function create(activityBlueprintData) { const { number, academicYear, type, startDate, endDate, - } = activityBlueprintDataData; + } = activityBlueprintData; const activityblueprint = new ActivityBlueprint({ number, - academicYear, - type, - startDate, + academicYear, + type, + startDate, endDate, }); const activityblueprintDoc = await activityblueprint.save(); @@ -48,6 +48,6 @@ async function update(filter, updateObject, options = { multi: true }) { return deleteResult.acknowledged; } -export default{ +export default { create, read, update, remove, -} \ No newline at end of file +}; From b8960334f633843ff89f2101e4563c02bdad6154 Mon Sep 17 00:00:00 2001 From: Rahul Date: Sat, 9 Sep 2023 18:43:44 +0530 Subject: [PATCH 2/2] [fixed] a spelling error in ./models/activityBlueprint.js line number 29 --- models/activityBlueprint.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/models/activityBlueprint.js b/models/activityBlueprint.js index 504e834..dd6e451 100644 --- a/models/activityBlueprint.js +++ b/models/activityBlueprint.js @@ -6,7 +6,7 @@ const activityBluePrintSchema = { type: String, required: true, validate: { - validator: (value) => /^20\d{2}$/.test(value), // changed the valid year format starting from "20" !! + validator: (value) => /^20\d{2}$/.test(value), //changed the valid year format starting from "20" !! message: (props) => `${props.value} is not a valid year format starting with "2"!`, }, }, @@ -29,9 +29,9 @@ async function create(activityBlueprintData) { } = activityBlueprintData; const activityblueprint = new ActivityBlueprint({ number, - academicYear, - type, - startDate, + academicYear, + type, + startDate, endDate, }); const activityblueprintDoc = await activityblueprint.save(); @@ -48,6 +48,6 @@ async function update(filter, updateObject, options = { multi: true }) { return deleteResult.acknowledged; } -export default { +export default{ create, read, update, remove, -}; +} \ No newline at end of file