mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-01 15:29:19 +03:00
Moved `/media/thumbnail/
Admin API endpoint to /media/thumbnail/upload
refs https://github.com/TryGhost/Toolbox/issues/120 - Changed endpoint name as it suits way better to the `/upload` postfix convention we use along with all other endpoints that support file uploads
This commit is contained in:
parent
ced7b858dd
commit
4721b75463
@ -244,7 +244,7 @@ module.exports = function apiRoutes() {
|
|||||||
apiMw.upload.mediaValidation({type: 'media'}),
|
apiMw.upload.mediaValidation({type: 'media'}),
|
||||||
http(api.media.upload)
|
http(api.media.upload)
|
||||||
);
|
);
|
||||||
router.put('/media/thumbnail/',
|
router.put('/media/thumbnail/upload',
|
||||||
labs.enabledMiddleware('mediaAPI'),
|
labs.enabledMiddleware('mediaAPI'),
|
||||||
mw.authAdminApi,
|
mw.authAdminApi,
|
||||||
apiMw.upload.single('file'),
|
apiMw.upload.single('file'),
|
||||||
|
@ -86,7 +86,7 @@ describe('Media API', function () {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('media/thumbnail/:url', function () {
|
describe('media/thumbnail/upload', function () {
|
||||||
it('Can update existing thumbnail', async function () {
|
it('Can update existing thumbnail', async function () {
|
||||||
const res = await request.post(localUtils.API.getApiQuery('media/upload'))
|
const res = await request.post(localUtils.API.getApiQuery('media/upload'))
|
||||||
.set('Origin', config.get('url'))
|
.set('Origin', config.get('url'))
|
||||||
@ -102,7 +102,7 @@ describe('Media API', function () {
|
|||||||
media.push(res.body.media[0].url.replace(config.get('url'), ''));
|
media.push(res.body.media[0].url.replace(config.get('url'), ''));
|
||||||
media.push(res.body.media[0].thumbnail_url.replace(config.get('url'), ''));
|
media.push(res.body.media[0].thumbnail_url.replace(config.get('url'), ''));
|
||||||
|
|
||||||
const thumbnailRes = await request.put(localUtils.API.getApiQuery(`media/thumbnail/`))
|
const thumbnailRes = await request.put(localUtils.API.getApiQuery(`media/thumbnail/upload`))
|
||||||
.set('Origin', config.get('url'))
|
.set('Origin', config.get('url'))
|
||||||
.expect('Content-Type', /json/)
|
.expect('Content-Type', /json/)
|
||||||
.field('url', res.body.media[0].url)
|
.field('url', res.body.media[0].url)
|
||||||
@ -127,7 +127,7 @@ describe('Media API', function () {
|
|||||||
|
|
||||||
media.push(res.body.media[0].url.replace(config.get('url'), ''));
|
media.push(res.body.media[0].url.replace(config.get('url'), ''));
|
||||||
|
|
||||||
const thumbnailRes = await request.put(localUtils.API.getApiQuery(`media/thumbnail/`))
|
const thumbnailRes = await request.put(localUtils.API.getApiQuery(`media/thumbnail/upload`))
|
||||||
.set('Origin', config.get('url'))
|
.set('Origin', config.get('url'))
|
||||||
.expect('Content-Type', /json/)
|
.expect('Content-Type', /json/)
|
||||||
.field('url', res.body.media[0].url)
|
.field('url', res.body.media[0].url)
|
||||||
|
Loading…
Reference in New Issue
Block a user