Fix empty orders in getSortedOrders
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -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
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user