From cb31616a8710ad8c58af7a96284ef43af0600e74 Mon Sep 17 00:00:00 2001 From: Carlosokumu Date: Mon, 26 Aug 2024 21:58:21 +0300 Subject: [PATCH] check for 4 digits input --- internal/handlers/ussd/menuhandler.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/handlers/ussd/menuhandler.go b/internal/handlers/ussd/menuhandler.go index a53cb54..4c1599a 100644 --- a/internal/handlers/ussd/menuhandler.go +++ b/internal/handlers/ussd/menuhandler.go @@ -229,7 +229,8 @@ func (h *Handlers) SaveYob(cxt context.Context, sym string, input []byte) (resou if err != nil { return res, err } - if len(input) > 0 { + yob := string(input) + if len(yob) > 4 { yob := string(input) accountData["YOB"] = yob updatedJsonData, err := json.Marshal(accountData)