Skip to content

Commit

Permalink
Add validation
Browse files Browse the repository at this point in the history
  • Loading branch information
Zaptoss committed Jul 10, 2024
1 parent cc26601 commit f33f4e8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/service/handlers/update_event_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ func UpdateEventType(w http.ResponseWriter, r *http.Request) {
return
}

if len(res) == 0 {
Log(r).Error("Count of updated event_types = 0")
ape.RenderErr(w, problems.InternalError())
return
}

EventTypes(r).Push(typeModel)
ape.Render(w, newEventTypeResponse(res[0]))
}
Expand Down

0 comments on commit f33f4e8

Please sign in to comment.