From 78aae5addd3758ab62c051565287ed69f0761357 Mon Sep 17 00:00:00 2001 From: Michael Van Diest Date: Thu, 10 Mar 2016 09:29:27 -0500 Subject: [PATCH] fix: composite api endpoint uri changed --- src/index.js | 2 +- src/util.js | 4 +++- test/index.js | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/index.js b/src/index.js index c017df7..d65cd61 100644 --- a/src/index.js +++ b/src/index.js @@ -81,7 +81,7 @@ function forteApi(credentials, scope, options) { composite: { query(query) { validateArgs('composite_query', arguments) - return client.post(ApiPaths.composite.query, { data: query }) + return client.post(ApiPaths.composite.query(scope), { data: query }) } } } diff --git a/src/util.js b/src/util.js index 3582371..f212ead 100644 --- a/src/util.js +++ b/src/util.js @@ -53,7 +53,9 @@ export const ApiPaths = { } }, composite: { - query: '/composite' + query(scope) { + return `/forte/composite/${scope.trunk}/${scope.branch}/` + } } } diff --git a/test/index.js b/test/index.js index 936fc3b..6632c29 100644 --- a/test/index.js +++ b/test/index.js @@ -459,7 +459,7 @@ describe('forteApi', () => { } ] validQueries.forEach((query) => { - let expected = expectedUri(ApiPaths.composite.query) + let expected = expectedUri(ApiPaths.composite.query(validTrunkAndBranchScope)) //it(`should POST uri: ${expected} with body ${JSON.stringify(query)}`, () => { it(`should POST uri: ${expected}`, () => { let getCompositeMock = mockapi.post(expected, 200, query)