mirror of
https://github.com/strapi/strapi.git
synced 2025-12-27 23:24:03 +00:00
Remove useless clone object
This commit is contained in:
parent
2f4635bf4c
commit
54af44901b
@ -9,7 +9,7 @@ module.exports = async (ctx, next) => {
|
||||
if (controller && action) {
|
||||
// Redirect to specific controller.
|
||||
if (ctx.request.body.hasOwnProperty('fields') && ctx.request.body.hasOwnProperty('files')) {
|
||||
let {files, fields} = _.cloneDeep(ctx.request.body);
|
||||
let {files, fields} = ctx.request.body;
|
||||
|
||||
const parser = (value) => {
|
||||
try {
|
||||
@ -30,7 +30,7 @@ module.exports = async (ctx, next) => {
|
||||
ctx.request.body = fields;
|
||||
|
||||
await strapi.plugins[source].controllers[controller.toLowerCase()][action](ctx);
|
||||
const resBody = _.cloneDeep(ctx.body);
|
||||
const resBody = ctx.body;
|
||||
|
||||
await Promise.all(Object.keys(files).map(async field => {
|
||||
ctx.request.body = {
|
||||
|
||||
@ -23,8 +23,7 @@
|
||||
"users": {
|
||||
"collection": "user",
|
||||
"via": "role",
|
||||
"plugin": "users-permissions",
|
||||
"configurable": false
|
||||
"plugin": "users-permissions"
|
||||
},
|
||||
"permissions": {
|
||||
"collection": "permission",
|
||||
@ -33,4 +32,4 @@
|
||||
"configurable": false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -38,6 +38,12 @@
|
||||
"via": "users",
|
||||
"plugin": "users-permissions",
|
||||
"configurable": false
|
||||
},
|
||||
"picture": {
|
||||
"collection": "file",
|
||||
"via": "related",
|
||||
"plugin": "upload"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"collectionName": "users-permissions_user"
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user