From 5ed77e68c44ebbb243a636d0b8ebf28d531d9d35 Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Wed, 29 Mar 2023 16:29:30 +0300 Subject: [PATCH] fix: show nice labels for filters --- static/components/order-list/order-list.js | 24 ++++++++++++++-------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/static/components/order-list/order-list.js b/static/components/order-list/order-list.js index 33d3b35..5d1d863 100644 --- a/static/components/order-list/order-list.js +++ b/static/components/order-list/order-list.js @@ -14,22 +14,28 @@ async function orderList(path) { filter: '', search: { publicKey: '', - isPaid: null, - isShipped: null + isPaid: { + label: 'All', + id: null + }, + isShipped: { + label: 'All', + id: null + } }, customers: [], ternaryOptions: [ { label: 'All', - value: null + id: null }, { label: 'Yes', - value: 'true' + id: 'true' }, { label: 'No', - value: 'false' + id: 'false' } ], ordersTable: { @@ -110,11 +116,11 @@ async function orderList(path) { if (this.search.publicKey) { query.push(`pubkey=${this.search.publicKey}`) } - if (this.search.isPaid) { - query.push(`paid=${this.search.isPaid}`) + if (this.search.isPaid.id) { + query.push(`paid=${this.search.isPaid.id}`) } - if (this.search.isShipped) { - query.push(`shipped=${this.search.isShipped}`) + if (this.search.isShipped.id) { + query.push(`shipped=${this.search.isShipped.id}`) } const {data} = await LNbits.api.request( 'GET',