mirror of
https://github.com/DoctorMcKay/node-steamcommunity.git
synced 2025-03-13 14:30:10 +08:00
remove options argument for updatePrice method
This commit is contained in:
parent
5c2894a7d4
commit
eae78aab93
@ -2,7 +2,6 @@ var SteamCommunity = require('../index.js');
|
||||
var Cheerio = require('cheerio');
|
||||
|
||||
SteamCommunity.prototype.getMarketItem = function(appid, hashName, currency, callback) {
|
||||
// steamCommunity.getMarketItem(appID, hashName, function(){...});
|
||||
if (typeof currency == "function") {
|
||||
callback = currency;
|
||||
currency = 1;
|
||||
@ -20,7 +19,7 @@ SteamCommunity.prototype.getMarketItem = function(appid, hashName, currency, cal
|
||||
}
|
||||
|
||||
var item = new CMarketItem(appid, hashName, self, body, $);
|
||||
item.updatePrice({currency: currency}, function(err) {
|
||||
item.updatePrice(currency, function(err) {
|
||||
if(err) {
|
||||
callback(err);
|
||||
} else {
|
||||
@ -103,25 +102,19 @@ function CMarketItem(appid, hashName, community, body, $) {
|
||||
// TODO: Buying listings and placing buy orders
|
||||
}
|
||||
|
||||
CMarketItem.prototype.updatePrice = function (options, callback) {
|
||||
options = options || {};
|
||||
options.currency = options.currency || 1;
|
||||
|
||||
CMarketItem.prototype.updatePrice = function (currency, callback) {
|
||||
if (this.commodity) {
|
||||
this.updatePriceForCommodity(options, callback);
|
||||
this.updatePriceForCommodity(currency, callback);
|
||||
} else {
|
||||
this.updatePriceForNonCommodity(options, callback);
|
||||
this.updatePriceForNonCommodity(currency, callback);
|
||||
}
|
||||
};
|
||||
|
||||
CMarketItem.prototype.updatePriceForCommodity = function(options, callback) {
|
||||
CMarketItem.prototype.updatePriceForCommodity = function(currency, callback) {
|
||||
if(!this.commodity) {
|
||||
throw new Error("Cannot update price for non-commodity item");
|
||||
}
|
||||
|
||||
options = options || {};
|
||||
var currency = options.currency;
|
||||
|
||||
var self = this;
|
||||
this._community.request({
|
||||
"uri": "https://steamcommunity.com/market/itemordershistogram?country=US&language=english¤cy=" + currency + "&item_nameid=" + this.commodityID,
|
||||
@ -160,14 +153,11 @@ CMarketItem.prototype.updatePriceForCommodity = function(options, callback) {
|
||||
});
|
||||
};
|
||||
|
||||
CMarketItem.prototype.updatePriceForNonCommodity = function (options, callback) {
|
||||
CMarketItem.prototype.updatePriceForNonCommodity = function (currency, callback) {
|
||||
if(this.commodity) {
|
||||
throw new Error("Cannot update price for commodity item");
|
||||
}
|
||||
|
||||
options = options || {};
|
||||
var currency = options.currency;
|
||||
|
||||
var self = this;
|
||||
this._community.request({
|
||||
"uri": "https://steamcommunity.com/market/listings/" +
|
||||
|
Loading…
Reference in New Issue
Block a user