Better job requests
This commit is contained in:
parent
62a761d270
commit
d00a867f5f
@ -151,7 +151,10 @@ class Products {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getJobRequest() {
|
getJobRequest() {
|
||||||
const maybeProduct = this.filter((_product, amount, _i, _j, end) => amount < 50 && end(true))
|
const maybeProduct = this.filter((_product, amount, _i, _j, end) => amount < 50).sort((a, b) => {
|
||||||
|
return a.amount - b.amount
|
||||||
|
})
|
||||||
|
console.log(maybeProduct);
|
||||||
return maybeProduct.length === 0 ? null : maybeProduct[0]
|
return maybeProduct.length === 0 ? null : maybeProduct[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user