Rename status to PENDING
This commit is contained in:
parent
358c44decc
commit
10eaecdf0d
|
@ -115,7 +115,7 @@ func (db *DB) CreateOrder(tx *sql.Tx, ctx context.Context, order *Order) error {
|
||||||
func (db *DB) FetchUserOrders(pubkey string, orders *[]Order) error {
|
func (db *DB) FetchUserOrders(pubkey string, orders *[]Order) error {
|
||||||
query := "" +
|
query := "" +
|
||||||
"SELECT o.id, share_id, o.pubkey, o.side, o.quantity, o.price, o.invoice_id, o.created_at, s.description, s.market_id, i.confirmed_at, " +
|
"SELECT o.id, share_id, o.pubkey, o.side, o.quantity, o.price, o.invoice_id, o.created_at, s.description, s.market_id, i.confirmed_at, " +
|
||||||
"CASE WHEN o.order_id IS NOT NULL THEN 'EXECUTED' ELSE 'WAITING' END AS status " +
|
"CASE WHEN o.order_id IS NOT NULL THEN 'EXECUTED' ELSE 'PENDING' END AS status " +
|
||||||
"FROM orders o " +
|
"FROM orders o " +
|
||||||
"JOIN invoices i ON o.invoice_id = i.id " +
|
"JOIN invoices i ON o.invoice_id = i.id " +
|
||||||
"JOIN shares s ON o.share_id = s.id " +
|
"JOIN shares s ON o.share_id = s.id " +
|
||||||
|
@ -137,7 +137,7 @@ func (db *DB) FetchUserOrders(pubkey string, orders *[]Order) error {
|
||||||
func (db *DB) FetchMarketOrders(marketId int64, orders *[]Order) error {
|
func (db *DB) FetchMarketOrders(marketId int64, orders *[]Order) error {
|
||||||
query := "" +
|
query := "" +
|
||||||
"SELECT o.id, share_id, o.pubkey, o.side, o.quantity, o.price, o.invoice_id, o.created_at, s.description, s.market_id, " +
|
"SELECT o.id, share_id, o.pubkey, o.side, o.quantity, o.price, o.invoice_id, o.created_at, s.description, s.market_id, " +
|
||||||
"CASE WHEN o.order_id IS NOT NULL THEN 'EXECUTED' ELSE 'WAITING' END AS status " +
|
"CASE WHEN o.order_id IS NOT NULL THEN 'EXECUTED' ELSE 'PENDING' END AS status " +
|
||||||
"FROM orders o " +
|
"FROM orders o " +
|
||||||
"JOIN shares s ON o.share_id = s.id " +
|
"JOIN shares s ON o.share_id = s.id " +
|
||||||
"JOIN invoices i ON i.id = o.invoice_id " +
|
"JOIN invoices i ON i.id = o.invoice_id " +
|
||||||
|
|
|
@ -23,7 +23,7 @@ const descClassName = computed(() => {
|
||||||
const statusClassName = computed(() => {
|
const statusClassName = computed(() => {
|
||||||
const status = order.value.Status
|
const status = order.value.Status
|
||||||
if (status === 'PAID') return 'success'
|
if (status === 'PAID') return 'success'
|
||||||
if (status === 'WAITING') return 'info'
|
if (status === 'PENDING') return 'info'
|
||||||
return 'error'
|
return 'error'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue