From 7a6a9ce879b8c3336b4238bdd4d76d1ac47ce04a Mon Sep 17 00:00:00 2001 From: ckoegel Date: Tue, 4 Jun 2024 17:03:21 -0400 Subject: [PATCH 1/3] SWI-5388 Fix Query Parameters for Some Endpoints --- lib/site.js | 6 +++--- test/site.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/site.js b/lib/site.js index 1edc0dc..7aeb26d 100644 --- a/lib/site.js +++ b/lib/site.js @@ -146,7 +146,7 @@ Site.prototype.getInserviceNumbers = function(query, callback){ callback = query; query = {}; } - this.client.makeRequest("get", this.client.concatAccountPath(SITE_PATH) + "/" + this.id + "/inserviceNumbers", function(err,res){ + this.client.makeRequest("get", this.client.concatAccountPath(SITE_PATH) + "/" + this.id + "/inserviceNumbers", query, function(err,res){ if(err){ return callback(err); } @@ -173,7 +173,7 @@ Site.prototype.getPortIns = function(query, callback){ callback = query; query = {}; } - this.client.makeRequest("get", this.client.concatAccountPath(SITE_PATH) + "/" + this.id + "/portins", function(err,res){ + this.client.makeRequest("get", this.client.concatAccountPath(SITE_PATH) + "/" + this.id + "/portins", query, function(err,res){ if(err){ return callback(err); } @@ -187,7 +187,7 @@ Site.prototype.getTotalTns = function(query, callback){ callback = query; query = {}; } - this.client.makeRequest("get", this.client.concatAccountPath(SITE_PATH) + "/" + this.id + "/totaltns", function(err,res){ + this.client.makeRequest("get", this.client.concatAccountPath(SITE_PATH) + "/" + this.id + "/totaltns", query, function(err,res){ if(err){ return callback(err); } diff --git a/test/site.js b/test/site.js index bfa029d..967e7cc 100644 --- a/test/site.js +++ b/test/site.js @@ -262,7 +262,7 @@ describe("Site", function(){ var site = new Site(); site.id = "1"; site.client = helper.createClient(); - site.getInserviceNumbers({}, function(err,res){ + site.getInserviceNumbers({page: 1, size: 100}, function(err,res){ if(err){ return done(err); } From d05dd214aec9a57a5af8e464959c634d6821eb9f Mon Sep 17 00:00:00 2001 From: ckoegel Date: Tue, 4 Jun 2024 17:06:46 -0400 Subject: [PATCH 2/3] fix url --- test/site.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/site.js b/test/site.js index 967e7cc..7ce31db 100644 --- a/test/site.js +++ b/test/site.js @@ -258,7 +258,7 @@ describe("Site", function(){ }); describe("#getInserviceNumbers", function(done){ it("should get a list of inservice numbers", function(done){ - helper.nock().get("/accounts/FakeAccountId/sites/1/inserviceNumbers").reply(200, helper.xml.inServiceNumbers, {"Content-Type": "application/xml"}); + helper.nock().get("/accounts/FakeAccountId/sites/1/inserviceNumbers?page=1&size=100").reply(200, helper.xml.inServiceNumbers, {"Content-Type": "application/xml"}); var site = new Site(); site.id = "1"; site.client = helper.createClient(); From a1793ef16e9cb4e5d99c30b8ef11bb5fa2017349 Mon Sep 17 00:00:00 2001 From: ckoegel Date: Tue, 4 Jun 2024 17:15:30 -0400 Subject: [PATCH 3/3] add one more query param --- lib/application.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/application.js b/lib/application.js index e922aa5..0ae50ce 100644 --- a/lib/application.js +++ b/lib/application.js @@ -100,7 +100,7 @@ Application.prototype.getSipPeers = function(query, callback){ callback = query; query = {}; } - this.client.makeRequest("get", this.client.concatAccountPath(APPLICATION_PATH) + "/" + this.applicationId + "/associatedsippeers", function(err,res){ + this.client.makeRequest("get", this.client.concatAccountPath(APPLICATION_PATH) + "/" + this.applicationId + "/associatedsippeers", query, function(err,res){ if(err){ return callback(err); }