Skip to content

Commit

Permalink
Merge pull request stakwork#2031 from stakwork/fix/feature_and_phase_…
Browse files Browse the repository at this point in the history
…uuid_format_validation

fix: stop validating uuid
  • Loading branch information
tobi-bams authored Dec 2, 2024
2 parents ea4c0c7 + b8e849d commit 6c589bd
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions handlers/ticket.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 6c589bd

Please sign in to comment.