mirror of
https://github.com/strapi/strapi.git
synced 2025-11-02 10:55:37 +00:00
Fix that returns an empty object when the admin user value is null
Signed-off-by: harimkims <harimkims@gmail.com>
This commit is contained in:
parent
2ff2ba860e
commit
de69873606
@ -108,7 +108,7 @@ module.exports = ({ action, ability, model }) => {
|
||||
const omitCreatorRoles = omit([`${CREATED_BY_ATTRIBUTE}.roles`, `${UPDATED_BY_ATTRIBUTE}.roles`]);
|
||||
|
||||
const pickAllowedAdminUserFields = ({ attribute, key, value }, { set }) => {
|
||||
if (attribute.type === 'relation' && attribute.target === 'admin::user') {
|
||||
if (attribute.type === 'relation' && attribute.target === 'admin::user' && value) {
|
||||
if (Array.isArray(value)) {
|
||||
set(key, value.map(val => pick(['id', 'firstname', 'lastname', 'username'], val)), value);
|
||||
} else {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user