Query using Api instead of javascript filter

This commit is contained in:
RubenPX 2022-04-28 11:31:24 +02:00
parent c8dc1b11e2
commit a945fc085f
1 changed files with 2 additions and 5 deletions

View File

@ -4,11 +4,8 @@ const Api = {
* @returns get lots
*/
async get_lots() {
const request = await this.doRequest(API_URLS.lots, "GET", null);
if (request != undefined) {
request.items = request.items.filter(itm => !itm.trade) // Avoid show outgoing or incomming trades
return request.items;
}
const request = await this.doRequest(`${API_URLS.lots}?type=temporary`, "GET", null);
if (request != undefined) return request.items;
throw request;
},