From dc77c084347300daf5e98c9d11a3919f1e8d159f Mon Sep 17 00:00:00 2001 From: Lan Phan Date: Wed, 27 Mar 2024 12:37:10 +0700 Subject: [PATCH] BUGFIX: issue #1037, get-order command error --- pkg/cmd/orders.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pkg/cmd/orders.go b/pkg/cmd/orders.go index 3e7ac116c..475237a20 100644 --- a/pkg/cmd/orders.go +++ b/pkg/cmd/orders.go @@ -46,6 +46,11 @@ var getOrderCmd = &cobra.Command{ } orderID, err := cmd.Flags().GetString("order-id") + if err != nil { + return fmt.Errorf("can't get the order-id from flags: %w", err) + } + + symbol, err := cmd.Flags().GetString("symbol") if err != nil { return fmt.Errorf("can't get the symbol from flags: %w", err) } @@ -57,6 +62,7 @@ var getOrderCmd = &cobra.Command{ order, err := service.QueryOrder(ctx, types.OrderQuery{ OrderID: orderID, + Symbol: symbol, }) if err != nil { return err @@ -101,9 +107,6 @@ var listOrdersCmd = &cobra.Command{ if err != nil { return fmt.Errorf("can't get the symbol from flags: %w", err) } - if symbol == "" { - return fmt.Errorf("symbol is not found") - } status := "open" if len(args) != 0 {