From 5ee99cdcd81a8824c79d735469ac8d4665389255 Mon Sep 17 00:00:00 2001 From: alfred-mk Date: Wed, 18 Feb 2026 12:42:25 +0300 Subject: [PATCH] convert the user input to uppercase before calling the pool Details API --- handlers/application/pools.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/handlers/application/pools.go b/handlers/application/pools.go index 23a9964..28612ff 100644 --- a/handlers/application/pools.go +++ b/handlers/application/pools.go @@ -3,6 +3,7 @@ package application import ( "context" "fmt" + "strings" "git.defalsify.org/vise.git/db" "git.defalsify.org/vise.git/resource" @@ -104,6 +105,7 @@ func (h *MenuHandlers) GetDefaultPool(ctx context.Context, sym string, input []b // ViewPool retrieves the pool details from the user store // and displays it to the user for them to select it. +// if the data does not exist, it calls the API to get the pool details func (h *MenuHandlers) ViewPool(ctx context.Context, sym string, input []byte) (resource.Result, error) { var res resource.Result sessionId, ok := ctx.Value("SessionId").(string) @@ -131,8 +133,11 @@ func (h *MenuHandlers) ViewPool(ctx context.Context, sym string, input []byte) ( if poolData == nil { flag_api_call_error, _ := h.flagManager.GetFlag("flag_api_call_error") + // convert to uppercase before the call + poolSymbol := strings.ToUpper(inputStr) + // no match found. Call the API using the inputStr as the symbol - poolResp, err := h.accountService.RetrievePoolDetails(ctx, inputStr) + poolResp, err := h.accountService.RetrievePoolDetails(ctx, poolSymbol) if err != nil { res.FlagSet = append(res.FlagSet, flag_api_call_error) return res, nil