diff --git a/middlewares/validators/account.validator.js b/middlewares/validators/account.validator.js index b20a8221..91ef6e1e 100644 --- a/middlewares/validators/account.validator.js +++ b/middlewares/validators/account.validator.js @@ -6,7 +6,7 @@ module.exports = { newAccountValidator: [ VALIDATOR.stringValidator("body", "firstName", false), VALIDATOR.stringValidator("body", "lastName", false), - VALIDATOR.stringValidator("body", "pronoun", false), + VALIDATOR.alphaArrayValidator("body", "pronoun", false), VALIDATOR.stringValidator("body", "gender", false), VALIDATOR.regexValidator("body", "email", false, Constants.EMAIL_REGEX), VALIDATOR.alphaArrayValidator("body", "dietaryRestrictions", false), @@ -24,7 +24,7 @@ module.exports = { updateAccountValidator: [ VALIDATOR.stringValidator("body", "firstName", true), VALIDATOR.stringValidator("body", "lastName", true), - VALIDATOR.stringValidator("body", "pronoun", true), + VALIDATOR.alphaArrayValidator("body", "pronoun", true), VALIDATOR.stringValidator("body", "gender", true), VALIDATOR.regexValidator("body", "email", true, Constants.EMAIL_REGEX), VALIDATOR.alphaArrayValidator("body", "dietaryRestrictions", true), diff --git a/models/account.model.js b/models/account.model.js index fe83490f..92e718d4 100644 --- a/models/account.model.js +++ b/models/account.model.js @@ -12,10 +12,10 @@ const AccountSchema = new mongoose.Schema({ type: String, required: true }, - pronoun: { + pronoun: [{ type: String, default: "Prefer not to say" - }, + }], gender: { type: String, default: "Prefer not to say" diff --git a/routes/api/account.js b/routes/api/account.js index 9481051b..c637d9bb 100644 --- a/routes/api/account.js +++ b/routes/api/account.js @@ -67,7 +67,7 @@ module.exports = { * * @apiParam (body) {String} firstName First name of the account creator. * @apiParam (body) {String} lastName Last name of the account creator. - * @apiParam (body) {String} pronoun the pronoun of the account creator. + * @apiParam (body) {String[]} pronoun the pronoun of the account creator. * @apiParam (body) {String} email Email of the account. * @apiParam (body) {String} gender Gender of the account creator. * @apiParam (body) {String[]} dietaryRestrictions Any dietary restrictions for the user. 'None' if there are no restrictions @@ -209,7 +209,7 @@ module.exports = { * * @apiParam (body) {String} [firstName] First name of the account creator. * @apiParam (body) {String} [lastName] Last name of the account creator. - * @apiParam (body) {String} [pronoun] The pronoun of the account creator. + * @apiParam (body) {String[]} [pronoun] The pronoun of the account creator. * @apiParam (body) {String} [email] Email of the account. * @apiParam (body) {String} [gender] Gender of the account creator. * @apiParam (body) {String} [age] Age of the account creator.