From 272591b0155833d3be53cf83abfae7d739df9bdc Mon Sep 17 00:00:00 2001 From: ekzyis Date: Sat, 2 Dec 2023 02:24:48 +0100 Subject: [PATCH] Fix empty stats --- db/market.go | 2 +- vue/src/components/MarketStats.vue | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/db/market.go b/db/market.go index 1f9d592..5490888 100644 --- a/db/market.go +++ b/db/market.go @@ -152,7 +152,7 @@ func (db *DB) FetchMarketOrders(marketId int64, orders *[]Order) error { "CASE WHEN o.order_id IS NOT NULL THEN 'EXECUTED' ELSE 'PENDING' END AS status, o.order_id " + "FROM orders o " + "JOIN shares s ON o.share_id = s.id " + - "WHERE s.market_id = $1 AND ( (o.side = 'BUY' AND o.order_id IS NOT NULL) OR o.side = 'SELL' ) " + + "WHERE s.market_id = $1 AND ( (o.side = 'BUY') OR o.side = 'SELL' ) " + "ORDER BY o.created_at DESC" rows, err := db.Query(query, marketId) if err != nil { diff --git a/vue/src/components/MarketStats.vue b/vue/src/components/MarketStats.vue index cafbdb9..e532a97 100644 --- a/vue/src/components/MarketStats.vue +++ b/vue/src/components/MarketStats.vue @@ -1,8 +1,8 @@