Skip to content

Commit

Permalink
SWI-5388 Fix Query Parameters for Some Endpoints (#68)
Browse files Browse the repository at this point in the history
* SWI-5388 Fix Query Parameters for Some Endpoints

* fix url

* add one more query param
  • Loading branch information
ckoegel authored Jun 4, 2024
1 parent eb92454 commit 5fb5813
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
6 changes: 3 additions & 3 deletions lib/site.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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);
}
Expand All @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions test/site.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,11 +258,11 @@ 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();
site.getInserviceNumbers({}, function(err,res){
site.getInserviceNumbers({page: 1, size: 100}, function(err,res){
if(err){
return done(err);
}
Expand Down

0 comments on commit 5fb5813

Please sign in to comment.