From dbba2befe7c08804d53ad4b547fe739af5c85973 Mon Sep 17 00:00:00 2001 From: Brad Morgan Date: Tue, 5 Sep 2023 15:20:11 -0700 Subject: [PATCH] trim values before accessing DB (#1499) Co-authored-by: Brad --- backend/models/project.model.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/backend/models/project.model.js b/backend/models/project.model.js index e345b2c4..47421aa4 100644 --- a/backend/models/project.model.js +++ b/backend/models/project.model.js @@ -16,19 +16,19 @@ Idea for the future: programmingLanguages, numberGithubContributions (pull these */ const projectSchema = mongoose.Schema({ - name: { type: String }, - description: { type: String }, - githubIdentifier: { type: String }, + name: { type: String, trim: true }, + description: { type: String, trim: true }, + githubIdentifier: { type: String, trim: true }, projectStatus: { type: String }, // Active, Completed, or Paused - location: { type: String }, // DTLA, Westside, South LA, or Remote (hacknight) + location: { type: String, trim: true }, // DTLA, Westside, South LA, or Remote (hacknight) //teamMembers: { type: String }, // commented since we should be able to get this from Project Team Members table createdDate: { type: Date, default: Date.now }, // date/time project was created completedDate: { type: Date }, // only if Status = Completed, date/time completed - githubUrl: { type: String }, // link to main repo - slackUrl: { type: String }, // link to Slack channel - googleDriveUrl: { type: String }, + githubUrl: { type: String, trim: true }, // link to main repo + slackUrl: { type: String, trim: true }, // link to Slack channel + googleDriveUrl: { type: String, trim: true }, googleDriveId: { type: String }, - hflaWebsiteUrl: { type: String }, + hflaWebsiteUrl: { type: String, trim: true }, videoConferenceLink: { type: String }, lookingDescription: { type: String }, // narrative on what the project is looking for recruitingCategories: [{ type: String }], // same as global Skills picklist