mirror of
https://github.com/strapi/strapi.git
synced 2025-11-01 18:33:55 +00:00
Fix upload api
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
This commit is contained in:
parent
8fd98b0c33
commit
e18c54b225
@ -77,9 +77,9 @@ module.exports = {
|
||||
|
||||
async replaceFile(ctx) {
|
||||
const {
|
||||
id,
|
||||
query: { id },
|
||||
request: { body, files: { files } = {} },
|
||||
} = ctx.query;
|
||||
} = ctx;
|
||||
|
||||
// cannot replace with more than one file
|
||||
if (Array.isArray(files)) {
|
||||
@ -99,7 +99,7 @@ module.exports = {
|
||||
async uploadFiles(ctx) {
|
||||
const {
|
||||
request: { body, files: { files } = {} },
|
||||
} = ctx.query;
|
||||
} = ctx;
|
||||
|
||||
ctx.body = await strapi.plugins.upload.services.upload.upload({
|
||||
data: await validateUploadBody(body),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user