mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-29 09:43:10 -06:00
Fix push server internal http wiring
This commit is contained in:
parent
b89da40cbd
commit
c9e94b4751
|
|
@ -54,22 +54,22 @@ func AddRoutes(r api.PushserverInternalAPI, internalAPIMux *mux.Router) {
|
|||
}),
|
||||
)
|
||||
|
||||
internalAPIMux.Handle(QueryPushRulesPath,
|
||||
httputil.MakeInternalAPI("queryPushRules", func(req *http.Request) util.JSONResponse {
|
||||
request := api.QueryPushRulesRequest{}
|
||||
response := api.QueryPushRulesResponse{}
|
||||
internalAPIMux.Handle(QueryPushersPath,
|
||||
httputil.MakeInternalAPI("queryPushers", func(req *http.Request) util.JSONResponse {
|
||||
request := api.QueryPushersRequest{}
|
||||
response := api.QueryPushersResponse{}
|
||||
if err := json.NewDecoder(req.Body).Decode(&request); err != nil {
|
||||
return util.MessageResponse(http.StatusBadRequest, err.Error())
|
||||
}
|
||||
if err := r.QueryPushRules(req.Context(), &request, &response); err != nil {
|
||||
if err := r.QueryPushers(req.Context(), &request, &response); err != nil {
|
||||
return util.ErrorResponse(err)
|
||||
}
|
||||
return util.JSONResponse{Code: http.StatusOK, JSON: &response}
|
||||
}),
|
||||
)
|
||||
|
||||
internalAPIMux.Handle(PerformPusherDeletionPath,
|
||||
httputil.MakeInternalAPI("performPusherDeletion", func(req *http.Request) util.JSONResponse {
|
||||
internalAPIMux.Handle(PerformPushRulesPutPath,
|
||||
httputil.MakeInternalAPI("performPushRulesPut", func(req *http.Request) util.JSONResponse {
|
||||
request := api.PerformPushRulesPutRequest{}
|
||||
response := struct{}{}
|
||||
if err := json.NewDecoder(req.Body).Decode(&request); err != nil {
|
||||
|
|
|
|||
Loading…
Reference in a new issue