Fix empty orders in getSortedOrders
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2022-07-04 12:38:56 +03:00
parent 5433c7a1d2
commit ccf1aaba9b

View File

@@ -31,6 +31,10 @@ class Api {
async getSortedOrders (url) { async getSortedOrders (url) {
const orders = await this.getOrders(url) const orders = await this.getOrders(url)
if (orders.length === 0) {
return []
}
return orders.sort(function (a, b) { return orders.sort(function (a, b) {
return a.platinum - b.platinum return a.platinum - b.platinum
}) })