From 1f392d143f27a508f5c9a721e6e904e593d0497b Mon Sep 17 00:00:00 2001 From: Roxana Mafteiu-Scai Date: Wed, 20 Mar 2024 10:18:00 +0100 Subject: [PATCH] fix: wrong url of new fetch contactlist endpoint --- api/endpoints/contactlist/index.js | 4 ++-- api/endpoints/contactlist/index.spec.js | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/api/endpoints/contactlist/index.js b/api/endpoints/contactlist/index.js index 4e84ec4..16a9c61 100644 --- a/api/endpoints/contactlist/index.js +++ b/api/endpoints/contactlist/index.js @@ -45,7 +45,7 @@ _.extend(ContactList.prototype, { logger.log('contactlist_fetch'); if (payload.next) { - var url = util.format('/v2%s', payload.next); + var url = payload.next; return this._request.get( this._getCustomerId(options), url, @@ -53,7 +53,7 @@ _.extend(ContactList.prototype, { ); } - var url = util.format('/v2/contactlist/%s/contactIds', payload.contact_list_id); + var url = util.format('/contactlist/%s/contactIds', payload.contact_list_id); return this._request.get( this._getCustomerId(options), this._buildUrl(url, payload, ['contact_list_id'], false), diff --git a/api/endpoints/contactlist/index.spec.js b/api/endpoints/contactlist/index.spec.js index cca2562..3ebdfd2 100644 --- a/api/endpoints/contactlist/index.spec.js +++ b/api/endpoints/contactlist/index.spec.js @@ -32,27 +32,27 @@ describe('SuiteAPI Contact List endpoint', function() { testApiMethod(ContactListApi, 'fetch').withArgs({ contact_list_id: 2 - }).shouldGetResultFromEndpoint('/v2/contactlist/2/contactIds'); + }).shouldGetResultFromEndpoint('/contactlist/2/contactIds'); testApiMethod(ContactListApi, 'fetch').withArgs({ contact_list_id: 2, next: '/contactlist/2/contactIds?$skiptoken=750&$top=1000' - }).shouldGetResultFromEndpoint('/v2/contactlist/2/contactIds?$skiptoken=750&$top=1000'); + }).shouldGetResultFromEndpoint('/contactlist/2/contactIds?$skiptoken=750&$top=1000'); testApiMethod(ContactListApi, 'fetch').withArgs({ contact_list_id: 2 - }).shouldGetResultFromEndpoint('/v2/contactlist/2/contactIds'); + }).shouldGetResultFromEndpoint('/contactlist/2/contactIds'); testApiMethod(ContactListApi, 'fetch').withArgs({ contact_list_id: 2, $skiptoken: 4 - }).shouldGetResultFromEndpoint('/v2/contactlist/2/contactIds?$skiptoken=4'); + }).shouldGetResultFromEndpoint('/contactlist/2/contactIds?$skiptoken=4'); testApiMethod(ContactListApi, 'fetch').withArgs({ contact_list_id: 2, $skiptoken: 4, $top: 10000 - }).shouldGetResultFromEndpoint('/v2/contactlist/2/contactIds?$skiptoken=4&$top=10000'); + }).shouldGetResultFromEndpoint('/contactlist/2/contactIds?$skiptoken=4&$top=10000'); });