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