mirror of
https://github.com/strapi/strapi.git
synced 2025-11-03 03:17:11 +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) {
|
async replaceFile(ctx) {
|
||||||
const {
|
const {
|
||||||
id,
|
query: { id },
|
||||||
request: { body, files: { files } = {} },
|
request: { body, files: { files } = {} },
|
||||||
} = ctx.query;
|
} = ctx;
|
||||||
|
|
||||||
// cannot replace with more than one file
|
// cannot replace with more than one file
|
||||||
if (Array.isArray(files)) {
|
if (Array.isArray(files)) {
|
||||||
@ -99,7 +99,7 @@ module.exports = {
|
|||||||
async uploadFiles(ctx) {
|
async uploadFiles(ctx) {
|
||||||
const {
|
const {
|
||||||
request: { body, files: { files } = {} },
|
request: { body, files: { files } = {} },
|
||||||
} = ctx.query;
|
} = ctx;
|
||||||
|
|
||||||
ctx.body = await strapi.plugins.upload.services.upload.upload({
|
ctx.body = await strapi.plugins.upload.services.upload.upload({
|
||||||
data: await validateUploadBody(body),
|
data: await validateUploadBody(body),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user