mirror of
https://github.com/DoctorMcKay/node-steamcommunity.git
synced 2025-03-23 21:50:10 +08:00
Cleaned up help.js
This commit is contained in:
parent
d093466d27
commit
8ffa0b50d4
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user