mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-03 03:55:26 +03:00
9d4b0c09a8
refs #10438 - As the support of /uploads endpoint has been dropped in Admin API, all related files have to correspond to new naming
20 lines
481 B
JavaScript
20 lines
481 B
JavaScript
const storage = require('../../adapters/storage');
|
|
|
|
module.exports = {
|
|
docName: 'images',
|
|
upload: {
|
|
statusCode: 201,
|
|
permissions: false,
|
|
query(frame) {
|
|
const store = storage.getStorage();
|
|
|
|
if (frame.files) {
|
|
return Promise
|
|
.map(frame.files, file => store.save(file))
|
|
.then(paths => paths[0]);
|
|
}
|
|
return store.save(frame.file);
|
|
}
|
|
}
|
|
};
|