diff --git a/src/lib/taxonomy-query.ts b/src/lib/taxonomy-query.ts index 26da6a8..11e6d9b 100644 --- a/src/lib/taxonomy-query.ts +++ b/src/lib/taxonomy-query.ts @@ -21,7 +21,7 @@ export class TaxonomyQuery extends Query { * const result = await taxonomyQuery.find(); */ override async find(): Promise> { - this._urlPath = "/taxonomy-manager"; // TODO: change to /taxonomies + this._urlPath = "/taxonomies"; const response = await getData(this._client, this._urlPath, { params: this._queryParams, }); diff --git a/src/lib/taxonomy.ts b/src/lib/taxonomy.ts index 64a7086..719fefd 100644 --- a/src/lib/taxonomy.ts +++ b/src/lib/taxonomy.ts @@ -21,7 +21,7 @@ export class Taxonomy { constructor(client: AxiosInstance, taxonomyUid: string) { this._client = client; this._taxonomyUid = taxonomyUid; - this._urlPath = `/taxonomy-manager/${this._taxonomyUid}`; // TODO: change to /taxonomies/${this._taxonomyUid} + this._urlPath = `/taxonomies/${this._taxonomyUid}`; } /** diff --git a/src/lib/term-query.ts b/src/lib/term-query.ts index 8f0a4ce..e707bcd 100644 --- a/src/lib/term-query.ts +++ b/src/lib/term-query.ts @@ -19,7 +19,7 @@ export class TermQuery { constructor(client: AxiosInstance, taxonomyUid: string) { this._client = client; this._taxonomyUid = taxonomyUid; - this._urlPath = `/taxonomy-manager/${this._taxonomyUid}/terms`; + this._urlPath = `/taxonomies/${this._taxonomyUid}/terms`; } /** diff --git a/src/lib/term.ts b/src/lib/term.ts index c4799db..bfbb765 100644 --- a/src/lib/term.ts +++ b/src/lib/term.ts @@ -20,7 +20,7 @@ export class Term { this._client = client; this._taxonomyUid = taxonomyUid; this._termUid = termUid; - this._urlPath = `/taxonomy-manager/${this._taxonomyUid}/terms/${this._termUid}`; // TODO: change to /taxonomies + this._urlPath = `/taxonomies/${this._taxonomyUid}/terms/${this._termUid}`; } /** diff --git a/test/unit/taxonomy.spec.ts b/test/unit/taxonomy.spec.ts index 5db38cb..e0f172d 100644 --- a/test/unit/taxonomy.spec.ts +++ b/test/unit/taxonomy.spec.ts @@ -34,13 +34,13 @@ describe('ta class', () => { }); it('should return all taxonomies in the response data when successful', async () => { - mockClient.onGet('/taxonomy-manager').reply(200, taxonomyFindResponseDataMock); //TODO: change to /taxonomies + mockClient.onGet('/taxonomies').reply(200, taxonomyFindResponseDataMock); const response = await taxonomies.find(); expect(response).toEqual(taxonomyFindResponseDataMock); }); it('should return single taxonomy in the response data when successful', async () => { - mockClient.onGet('/taxonomy-manager/taxonomy_testing').reply(200, taxonomyFindResponseDataMock.taxonomies[0]); //TODO: change to /taxonomies/taxonomyUid + mockClient.onGet('/taxonomies/taxonomy_testing').reply(200, taxonomyFindResponseDataMock.taxonomies[0]); const response = await taxonomy.fetch(); expect(response).toEqual(taxonomyFindResponseDataMock.taxonomies[0]); }); diff --git a/test/unit/term-query.spec.ts b/test/unit/term-query.spec.ts index a96019d..8b09fa1 100644 --- a/test/unit/term-query.spec.ts +++ b/test/unit/term-query.spec.ts @@ -19,7 +19,7 @@ describe('TermQuery class', () => { }); it('should return response data when successful', async () => { - mockClient.onGet('/taxonomy-manager/taxonomy_testing/terms').reply(200, termQueryFindResponseDataMock); + mockClient.onGet('/taxonomies/taxonomy_testing/terms').reply(200, termQueryFindResponseDataMock); const response = await termQuery.find(); expect(response).toEqual(termQueryFindResponseDataMock); }); diff --git a/test/unit/term.spec.ts b/test/unit/term.spec.ts index 0c404a4..3d41c23 100644 --- a/test/unit/term.spec.ts +++ b/test/unit/term.spec.ts @@ -20,28 +20,28 @@ describe('Term class', () => { }); it('should fetch the term by uid response when fetch method is called', async () => { - mockClient.onGet('/taxonomy-manager/taxonomy_testing/terms/term1').reply(200, termQueryFindResponseDataMock.terms[0]); //TODO: change to /taxonomies + mockClient.onGet('/taxonomies/taxonomy_testing/terms/term1').reply(200, termQueryFindResponseDataMock.terms[0]); const response = await term.fetch(); expect(response).toEqual(termQueryFindResponseDataMock.terms[0]); }); it('should fetch locales for a term when locales() is called', async () => { - mockClient.onGet('/taxonomy-manager/taxonomy_testing/terms/term1/locales').reply(200, termLocalesResponseDataMock.terms); //TODO: change to /taxonomies + mockClient.onGet('/taxonomies/taxonomy_testing/terms/term1/locales').reply(200, termLocalesResponseDataMock.terms); const response = await term.locales(); expect(response).toEqual(termLocalesResponseDataMock.terms); }); it('should fetch ancestors for a term when ancestors() is called', async () => { - mockClient.onGet('/taxonomy-manager/taxonomy_testing/terms/term1/ancestors').reply(200, termAncestorsResponseDataMock); + mockClient.onGet('/taxonomies/taxonomy_testing/terms/term1/ancestors').reply(200, termAncestorsResponseDataMock); const response = await term.ancestors(); expect(response).toEqual(termAncestorsResponseDataMock); }); it('should fetch descendants for a term when descendants() is called', async () => { - mockClient.onGet('/taxonomy-manager/taxonomy_testing/terms/term1/descendants').reply(200, termDescendantsResponseDataMock); + mockClient.onGet('/taxonomies/taxonomy_testing/terms/term1/descendants').reply(200, termDescendantsResponseDataMock); const response = await term.descendants(); expect(response).toEqual(termDescendantsResponseDataMock);