Skip to content

Commit

Permalink
Add args logic to handle global config
Browse files Browse the repository at this point in the history
  • Loading branch information
ajrice6713 committed Feb 28, 2022
1 parent 1427924 commit c5d2e08
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions lib/account.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ module.exports = {
},

getMoveTnsOrders: function(client, callback) {
if(arguments.length === 1){
callback = client;
client = new Client();
}
client.makeRequest("get", client.concatAccountPath("moveTns"), function(err,res){
if(err){
return callback(err);
Expand All @@ -38,6 +42,11 @@ module.exports = {
},

moveTns: function(client, item, callback) {
if(arguments.length === 2){
item = client;
callback = item;
client = new Client();
}
client.makeRequest("post", client.concatAccountPath(MOVE_TNS_PATH), {moveTnsOrder: item}, function(err, res){
if(err){
return callback(err, res);
Expand All @@ -47,6 +56,11 @@ module.exports = {
},

getMoveTnsOrder: function(client, id, callback) {
if(arguments.length === 2){
id = client;
callback = id;
client = new Client();
}
client.makeRequest("get", client.concatAccountPath("moveTns") + "/" + id, function(err,res){
if(err){
return callback(err);
Expand All @@ -56,6 +70,11 @@ module.exports = {
},

getMoveTnsOrderHistory: function(client, id, callback) {
if(arguments.length === 2){
id = client;
callback = id;
client = new Client();
}
client.makeRequest("get", client.concatAccountPath("moveTns")+ "/" + id + "/history", function(err,res){
if(err){
return callback(err);
Expand Down

0 comments on commit c5d2e08

Please sign in to comment.