From d1b8b5eea26fa6d9738bd7b3b39f16233c1825ed Mon Sep 17 00:00:00 2001 From: Hayden <64056131+hay-kot@users.noreply.github.com> Date: Fri, 5 Jan 2024 13:58:17 -0600 Subject: [PATCH] make case insensative --- backend/internal/core/currencies/currencies.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/internal/core/currencies/currencies.go b/backend/internal/core/currencies/currencies.go index cec1a60..505b6b1 100644 --- a/backend/internal/core/currencies/currencies.go +++ b/backend/internal/core/currencies/currencies.go @@ -8,6 +8,7 @@ import ( "encoding/json" "io" "slices" + "strings" "sync" ) @@ -89,8 +90,10 @@ func (cs *CurrencyRegistry) Slice() []Currency { } func (cs *CurrencyRegistry) IsSupported(code string) bool { + lower := strings.ToLower(code) + cs.mu.RLock() defer cs.mu.RUnlock() - _, ok := cs.registry[code] + _, ok := cs.registry[lower] return ok }