Skip to content

Commit

Permalink
✨ Theme Browse API endpoint (#8022)
Browse files Browse the repository at this point in the history
no issue
- adds `GET /themes/` endpoint for requesting all themes
  • Loading branch information
ErisDS authored and kevinansfield committed Feb 21, 2017
1 parent 348e4c2 commit 294561c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/server/api/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ function apiRoutes() {
apiRouter.get('/slugs/:type/:name', authenticatePrivate, api.http(api.slugs.generate));

// ## Themes
apiRouter.get('/themes/', authenticatePrivate, api.http(api.themes.browse));

apiRouter.get('/themes/:name/download',
authenticatePrivate,
api.http(api.themes.download)
Expand Down
4 changes: 4 additions & 0 deletions core/server/api/themes.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ themes = {
});
},

browse: function browse() {
return Promise.resolve({themes: settings.cache.get('availableThemes')});
},

upload: function upload(options) {
options = options || {};

Expand Down

0 comments on commit 294561c

Please sign in to comment.