mirror of
https://github.com/strapi/strapi.git
synced 2025-09-25 16:29:34 +00:00
add preferedLanguage
This commit is contained in:
parent
f7ce5b04fc
commit
ce3482025a
@ -17,7 +17,13 @@ module.exports = {
|
||||
return ctx.badRequest('ValidationError', err);
|
||||
}
|
||||
|
||||
const attributes = _.pick(body, ['firstname', 'lastname', 'email', 'roles']);
|
||||
const attributes = _.pick(body, [
|
||||
'firstname',
|
||||
'lastname',
|
||||
'email',
|
||||
'roles',
|
||||
'preferedLanguage',
|
||||
]);
|
||||
|
||||
const userAlreadyExists = await strapi.admin.services.user.exists({
|
||||
email: attributes.email,
|
||||
|
@ -70,6 +70,11 @@
|
||||
"default": false,
|
||||
"configurable": false,
|
||||
"private": true
|
||||
},
|
||||
"preferedLanguage": {
|
||||
"type": "string",
|
||||
"configurable": false,
|
||||
"required": false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ const userCreationSchema = yup
|
||||
firstname: validators.firstname.required(),
|
||||
lastname: validators.lastname.required(),
|
||||
roles: validators.roles.min(1),
|
||||
preferedLanguage: yup.string().nullable(),
|
||||
})
|
||||
.noUnknown();
|
||||
|
||||
@ -27,6 +28,7 @@ const profileUpdateSchema = yup
|
||||
lastname: validators.lastname.notNull(),
|
||||
username: validators.username.nullable(),
|
||||
password: validators.password.notNull(),
|
||||
preferedLanguage: yup.string().nullable(),
|
||||
})
|
||||
.noUnknown();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user