Skip to content

Commit

Permalink
Modify the type judgment of events
Browse files Browse the repository at this point in the history
  • Loading branch information
LinkLeong committed Dec 1, 2022
1 parent c503dde commit aa13f0c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion route/api_route_event.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,11 @@ func (r *APIRoute) SubscribeEvent(c echo.Context, sourceID codegen.SourceID, par
} else {
eventTypes, err := r.services.EventService.GetEventTypesBySourceID(sourceID)
if err != nil || len(eventTypes) == 0 {
message := err.Error()
if err != nil {
message := err.Error()
return c.JSON(http.StatusBadRequest, codegen.ResponseBadRequest{Message: &message})
}
message := "event types not found"
return c.JSON(http.StatusBadRequest, codegen.ResponseBadRequest{Message: &message})
}

Expand Down

0 comments on commit aa13f0c

Please sign in to comment.