From c5d2e085d2a9fd44b85173fca025c6bc27d79c7f Mon Sep 17 00:00:00 2001 From: AJ Rice <53190766+ajrice6713@users.noreply.github.com> Date: Mon, 28 Feb 2022 11:03:16 -0500 Subject: [PATCH] Add args logic to handle global config --- lib/account.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/lib/account.js b/lib/account.js index 5f975e2..a6b5856 100644 --- a/lib/account.js +++ b/lib/account.js @@ -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); @@ -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); @@ -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); @@ -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);