From b8e849d0968ecd36c3dbd46f8a7b9e528591f22d Mon Sep 17 00:00:00 2001 From: Oluwatobi Bamidele Date: Mon, 2 Dec 2024 10:11:58 +0100 Subject: [PATCH] fix: stop validating uuid --- handlers/ticket.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/handlers/ticket.go b/handlers/ticket.go index fe1d89189..0ac06b267 100644 --- a/handlers/ticket.go +++ b/handlers/ticket.go @@ -418,14 +418,15 @@ func (th *ticketHandler) GetTicketsByPhaseUUID(w http.ResponseWriter, r *http.Re featureUUID := chi.URLParam(r, "feature_uuid") phaseUUID := chi.URLParam(r, "phase_uuid") - if _, err := uuid.Parse(featureUUID); err != nil { - w.WriteHeader(http.StatusBadRequest) - json.NewEncoder(w).Encode(map[string]string{"error": "invalid feature UUID format"}) + if featureUUID == "" { + log.Println("feature uuid is missing") + http.Error(w, "Missing feature uuid", http.StatusBadRequest) return } - if _, err := uuid.Parse(phaseUUID); err != nil { - w.WriteHeader(http.StatusBadRequest) - json.NewEncoder(w).Encode(map[string]string{"error": "invalid phase UUID format"}) + + if phaseUUID == "" { + log.Println("phase uuid is missing") + http.Error(w, "Missing phase uuid", http.StatusBadRequest) return }