Skip to content

Commit

Permalink
fix: filter order list (#602)
Browse files Browse the repository at this point in the history
* fix filter

* remove console log

Co-authored-by: Hildegard Lydia <[email protected]>
  • Loading branch information
rubenkristian and hilyds authored Dec 9, 2022
1 parent 0c7939a commit 2cb3274
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/components/OrderList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,13 @@ export default {
this.isLoading = true
try {
const orderList = []
const listStatus = ["Refunded", "Fulfilled"]
const orders = await this.dispatch(getOrdersData, this.pair.address, this.page, this.pageSize, keyword)
for (let order of orders.data) {
const dna = await queryDnaSamples(this.api, order._source.dna_sample_tracking_id)
if (this.isDashboard && dna?.status === "Rejected") continue
if (!this.isDashboard && dna?.status === "ResultReady") continue
const dnaTestResult = await queryDnaTestResults(this.api, order._source.dna_sample_tracking_id)
const data = {
Expand All @@ -126,12 +126,7 @@ export default {
})
}
}
if (this.isDashboard) {
if (!listStatus.includes(data._source.status)) orderList.push(data)
} else {
if (listStatus.includes(data._source.status)) orderList.push(data)
}
orderList.push(data)
}
this.orders = orderList
Expand Down

0 comments on commit 2cb3274

Please sign in to comment.