diff --git a/packages/server/group/group.schema.js b/packages/server/group/group.schema.js index cd57db07..18a636f8 100644 --- a/packages/server/group/group.schema.js +++ b/packages/server/group/group.schema.js @@ -29,7 +29,7 @@ const GroupSchema = Schema( // from mongoose doc: // violating the constraint returns an E11000 error from MongoDB when saving, not a Mongoose validation error. unique: true, - set: normalizeString, + set: trimString, }, status: { type: String, diff --git a/packages/server/template/template.schema.js b/packages/server/template/template.schema.js index 29fa7021..b215cad8 100644 --- a/packages/server/template/template.schema.js +++ b/packages/server/template/template.schema.js @@ -5,7 +5,7 @@ const { Schema } = require('mongoose'); const { ObjectId } = Schema.Types; const mongooseHidden = require('mongoose-hidden')(); -const { normalizeString } = require('../utils/model'); +const { trimString } = require('../utils/model'); const { GroupModel } = require('../constant/model.names'); /** @@ -43,7 +43,7 @@ const TemplateSchema = Schema( type: String, unique: true, required: [true, 'name is required'], - set: normalizeString, + set: trimString, }, description: { type: String, diff --git a/packages/ui/components/group/form.vue b/packages/ui/components/group/form.vue index 41fc0228..b5feb75b 100644 --- a/packages/ui/components/group/form.vue +++ b/packages/ui/components/group/form.vue @@ -199,7 +199,7 @@ export default { :label="$t('global.name')" name="name" required - :disabled="disabled" + :disabled="disabled || isGroupAdmin" :error-messages="requiredErrors(`name`)" @input="$v.group.name.$touch()" @blur="$v.group.name.$touch()"