From 7ede8f95b98563c12e67ddfbfd3d696763bc4b7d Mon Sep 17 00:00:00 2001 From: danactive Date: Sat, 1 May 2021 17:52:29 -0700 Subject: [PATCH] fix(Gallery): Update with fragile code to use `app` business logic --- api/server/plugins/gallery/lib/index.js | 7 +++++-- ui/app/containers/HomePage/saga.js | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/api/server/plugins/gallery/lib/index.js b/api/server/plugins/gallery/lib/index.js index 7063152de..339aefaf1 100644 --- a/api/server/plugins/gallery/lib/index.js +++ b/api/server/plugins/gallery/lib/index.js @@ -6,7 +6,10 @@ async function register(server) { path: '/galleries', options: { tags: ['api'], - handler: async () => ({ galleries: await gallery.getGalleries() }), + handler: async () => { + const { body } = await gallery.get(); + return body; + }, }, }); } @@ -14,7 +17,7 @@ async function register(server) { const plugin = { register, name: 'gallery', - version: '0.4.0', + version: '0.5.0', }; module.exports = { plugin }; diff --git a/ui/app/containers/HomePage/saga.js b/ui/app/containers/HomePage/saga.js index 8c5941e28..300fc009f 100644 --- a/ui/app/containers/HomePage/saga.js +++ b/ui/app/containers/HomePage/saga.js @@ -38,7 +38,7 @@ export function* getDropboxGalleries() { function* getCdnFolders() { try { - const { galleries } = yield call(request, `${CDN_HOST}/galleryList`); + const { galleries } = yield call(request, `${CDN_HOST}/galleries`); yield put( galleriesLoadingSuccess({ cdn: galleries.map(name => ({ name, id: `cdn-${name}` })),