This commit is contained in:
Neil Alexander 2020-08-14 15:34:35 +01:00
parent 0db85d21dc
commit e502d6b6d1
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
2 changed files with 4 additions and 1 deletions

View file

@ -11,6 +11,7 @@ import (
) )
// AddRoutes adds the FederationSenderInternalAPI handlers to the http.ServeMux. // AddRoutes adds the FederationSenderInternalAPI handlers to the http.ServeMux.
// nolint:gocyclo
func AddRoutes(intAPI api.FederationSenderInternalAPI, internalAPIMux *mux.Router) { func AddRoutes(intAPI api.FederationSenderInternalAPI, internalAPIMux *mux.Router) {
internalAPIMux.Handle( internalAPIMux.Handle(
FederationSenderQueryJoinedHostServerNamesInRoomPath, FederationSenderQueryJoinedHostServerNamesInRoomPath,

View file

@ -33,7 +33,9 @@ func AddRoutes(r api.RoomserverInternalAPI, internalAPIMux *mux.Router) {
if err := json.NewDecoder(req.Body).Decode(&request); err != nil { if err := json.NewDecoder(req.Body).Decode(&request); err != nil {
return util.MessageResponse(http.StatusBadRequest, err.Error()) return util.MessageResponse(http.StatusBadRequest, err.Error())
} }
r.PerformInvite(req.Context(), &request, &response) if err := r.PerformInvite(req.Context(), &request, &response); err != nil {
return util.ErrorResponse(err)
}
return util.JSONResponse{Code: http.StatusOK, JSON: &response} return util.JSONResponse{Code: http.StatusOK, JSON: &response}
}), }),
) )