From 52771fc82c4b62a8fad6ea5ae9a0f9fc0ee0fba0 Mon Sep 17 00:00:00 2001 From: Riley Davis Date: Tue, 13 Dec 2016 12:45:58 -0700 Subject: [PATCH] pluralize asset endpoints --- client/coral-framework/actions/config.js | 4 ++-- docs/swagger.yaml | 8 ++++---- routes/api/{asset => assets}/index.js | 0 routes/api/index.js | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) rename routes/api/{asset => assets}/index.js (100%) diff --git a/client/coral-framework/actions/config.js b/client/coral-framework/actions/config.js index c88138534..77e7f5af5 100644 --- a/client/coral-framework/actions/config.js +++ b/client/coral-framework/actions/config.js @@ -16,7 +16,7 @@ export const updateConfiguration = newConfig => (dispatch, getState) => { .toArray()[0]; dispatch(updateConfigRequest()); - coralApi(`/asset/${assetId}/settings`, {method: 'PUT', body: newConfig}) + coralApi(`/assets/${assetId}/settings`, {method: 'PUT', body: newConfig}) .then(() => { dispatch(addNotification('success', lang.t('successUpdateSettings'))); dispatch(updateConfigSuccess(newConfig)); @@ -31,7 +31,7 @@ export const updateOpenStream = closedBody => (dispatch, getState) => { dispatch(updateConfigRequest()); - coralApi(`/asset/${assetId}/status`, {method: 'PUT', body: closedBody}) + coralApi(`/assets/${assetId}/status`, {method: 'PUT', body: closedBody}) .then(() => { dispatch(addNotification('success', lang.t('successUpdateSettings'))); dispatch(updateConfigSuccess(closedBody)); diff --git a/docs/swagger.yaml b/docs/swagger.yaml index e819f451c..f6aba4d25 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -256,7 +256,7 @@ paths: description: An error occured. schema: $ref: '#/definitions/Error' - /asset: + /assets: get: parameters: - name: limit @@ -294,7 +294,7 @@ paths: items: $ref: '#/definitions/Asset' - /asset/{asset_id}: + /assets/{asset_id}: get: parameters: - name: asset_id @@ -315,7 +315,7 @@ paths: $ref: '#/definitions/Error' - /asset/{asset_id}/scrape: + /assets/{asset_id}/scrape: post: parameters: - name: asset_id @@ -335,7 +335,7 @@ paths: schema: $ref: '#/definitions/Error' - /asset/{asset_id}/settings: + /assets/{asset_id}/settings: put: parameters: - name: asset_id diff --git a/routes/api/asset/index.js b/routes/api/assets/index.js similarity index 100% rename from routes/api/asset/index.js rename to routes/api/assets/index.js diff --git a/routes/api/index.js b/routes/api/index.js index 6a7f6ff10..316d284e0 100644 --- a/routes/api/index.js +++ b/routes/api/index.js @@ -7,7 +7,7 @@ const router = express.Router(); // Filter all content going down the pipe based on user roles. router.use(payloadFilter); -router.use('/asset', authorization.needed('admin'), require('./asset')); +router.use('/assets', authorization.needed('admin'), require('./assets')); router.use('/settings', authorization.needed('admin'), require('./settings')); router.use('/queue', authorization.needed('admin'), require('./queue'));