Skip to content

Commit

Permalink
Merge pull request #198 from roxaaams/rms/SUITEDEV-35218-fix-wrong-url
Browse files Browse the repository at this point in the history
fix: wrong url of new fetch contactlist endpoint
  • Loading branch information
akapa authored Mar 20, 2024
2 parents 2db2312 + 1f392d1 commit f253be7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions api/endpoints/contactlist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ _.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,
options
);
}

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),
Expand Down
10 changes: 5 additions & 5 deletions api/endpoints/contactlist/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});


Expand Down

0 comments on commit f253be7

Please sign in to comment.