From 148eae7274bcb0c2936425f00f2aa4dcc1422912 Mon Sep 17 00:00:00 2001 From: n1o5 <143865437+n1o5@users.noreply.github.com> Date: Fri, 15 May 2026 16:47:28 +0530 Subject: [PATCH 1/4] fix: add trim option to mongoose string fields to trim whitespace --- backend/src/models/Routine.js | 2 ++ backend/src/models/Task.js | 3 +++ backend/src/models/User.js | 4 ++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/backend/src/models/Routine.js b/backend/src/models/Routine.js index 542bdcb3..6e7b9260 100644 --- a/backend/src/models/Routine.js +++ b/backend/src/models/Routine.js @@ -10,6 +10,7 @@ const routineSchema = mongoose.Schema( name: { type: String, required: true, + trim: true }, items: [ // tasks { @@ -20,6 +21,7 @@ const routineSchema = mongoose.Schema( day: { type: String, required: true, + trim: true, enum: [ "Monday", "Tuesday", diff --git a/backend/src/models/Task.js b/backend/src/models/Task.js index c96d412e..43384636 100644 --- a/backend/src/models/Task.js +++ b/backend/src/models/Task.js @@ -10,14 +10,17 @@ const taskSchema = mongoose.Schema( title: { type: String, required: true, + trim: true }, description: { type: String, required: false, + trim: true }, tags: { type: String, required: false, + trim: true }, priority: { type: String, diff --git a/backend/src/models/User.js b/backend/src/models/User.js index 1c3a0c10..fa47bfd9 100644 --- a/backend/src/models/User.js +++ b/backend/src/models/User.js @@ -3,8 +3,8 @@ import mongoose from "mongoose"; // User schema const userSchema = mongoose.Schema( { - name: { type: String, required: true}, - email: { type: String, required: true, unique: true }, + name: { type: String, required: true, trim: true}, + email: { type: String, required: true, unique: true , trim: true}, password: { type: String, required: true }, }, { timestamps: true } From 73967eee1887c95e5f1d76793d065e3a769aadba Mon Sep 17 00:00:00 2001 From: n1o5 <143865437+n1o5@users.noreply.github.com> Date: Sun, 17 May 2026 07:44:32 +0530 Subject: [PATCH 2/4] fix: updating CI Node version to 20 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8e646f7f..1871a801 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: - node-version: [18] + node-version: [20] steps: - name: Checkout Code From cbf5d5d583981da427688fb9faa37e55b4ff9a80 Mon Sep 17 00:00:00 2001 From: Hamssini <143865437+n1o5@users.noreply.github.com> Date: Sat, 30 May 2026 11:36:05 +0530 Subject: [PATCH 3/4] Removed duplicate email and password from user schema Removed email and password fields from user schema. --- backend/src/models/User.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/backend/src/models/User.js b/backend/src/models/User.js index 325f7043..7c92201d 100644 --- a/backend/src/models/User.js +++ b/backend/src/models/User.js @@ -2,9 +2,6 @@ import mongoose from 'mongoose'; const userSchema = new mongoose.Schema( { - name: { type: String, required: true, trim: true}, - email: { type: String, required: true, unique: true , trim: true}, - password: { type: String, required: true }, name: { type: String, required: true, @@ -49,4 +46,4 @@ const userSchema = new mongoose.Schema( const User = mongoose.model('User', userSchema); -export default User; \ No newline at end of file +export default User; From 3430bf501f18bbe4f0278c0f91b70ea7f207ee71 Mon Sep 17 00:00:00 2001 From: Hamssini <143865437+n1o5@users.noreply.github.com> Date: Sat, 30 May 2026 11:41:42 +0530 Subject: [PATCH 4/4] Revert Node.js version from 20 to 18 in CI workflow --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 58d91970..20de2e38 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: - node-version: [20] + node-version: [18] steps: - name: Checkout Code @@ -64,4 +64,4 @@ jobs: - name: Build Frontend working-directory: frontend - run: npm run build \ No newline at end of file + run: npm run build