diff --git a/components/help.js b/components/help.js index 2441b22..ca82e1d 100644 --- a/components/help.js +++ b/components/help.js @@ -1,7 +1,5 @@ const SteamCommunity = require('../index.js'); -const Helpers = require('./helpers.js'); - /** * Restore a previously removed steam package from your steam account. * @param {int|string} packageID @@ -9,13 +7,13 @@ const Helpers = require('./helpers.js'); */ SteamCommunity.prototype.restorePackage = function(packageID, callback) { this.httpRequestPost({ - "uri": "https://help.steampowered.com/wizard/AjaxDoPackageRestore", - "form": { - "packageid": packageID, - "sessionid": this.getSessionID('https://help.steampowered.com'), - "wizard_ajax": 1 + uri: 'https://help.steampowered.com/wizard/AjaxDoPackageRestore', + form: { + packageid: packageID, + sessionid: this.getSessionID('https://help.steampowered.com'), + wizard_ajax: 1 }, - "json": true + json: true }, (err, res, body) => { if (!callback) { return; @@ -27,7 +25,7 @@ SteamCommunity.prototype.restorePackage = function(packageID, callback) { } if (!body.success) { - callback(body.errorMsg ? new Error(body.errorMsg) : Helpers.eresultError(body.success)); + callback(new Error(body.errorMsg || 'Unexpected error')); return; } @@ -42,13 +40,13 @@ SteamCommunity.prototype.restorePackage = function(packageID, callback) { */ SteamCommunity.prototype.removePackage = function(packageID, callback) { this.httpRequestPost({ - "uri": "https://help.steampowered.com/wizard/AjaxDoPackageRemove", - "form": { - "packageid": packageID, - "sessionid": this.getSessionID('https://help.steampowered.com'), - "wizard_ajax": 1 + uri: 'https://help.steampowered.com/wizard/AjaxDoPackageRemove', + form: { + packageid: packageID, + sessionid: this.getSessionID('https://help.steampowered.com'), + wizard_ajax: 1 }, - "json": true + json: true }, (err, res, body) => { if (!callback) { return; @@ -60,7 +58,7 @@ SteamCommunity.prototype.removePackage = function(packageID, callback) { } if (!body.success) { - callback(body.errorMsg ? new Error(body.errorMsg) : Helpers.eresultError(body.success)); + callback(new Error(body.errorMsg || 'Unexpected error')); return; }