convert the user input to uppercase before calling the pool Details API

This commit is contained in:
Alfred Kamanda 2026-02-18 12:42:25 +03:00
parent 6abcb97f3a
commit 5ee99cdcd8
Signed by: Alfred-mk
GPG Key ID: 7EA3D01708908703

View File

@ -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