From a945fc085f05f8ed1c1c9fe135dbf70612bf6747 Mon Sep 17 00:00:00 2001 From: RubenPX Date: Thu, 28 Apr 2022 11:31:24 +0200 Subject: [PATCH] Query using Api instead of javascript filter --- ereuse_devicehub/static/js/api.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/ereuse_devicehub/static/js/api.js b/ereuse_devicehub/static/js/api.js index 8163e293..552544d2 100644 --- a/ereuse_devicehub/static/js/api.js +++ b/ereuse_devicehub/static/js/api.js @@ -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; },