mirror of
https://github.com/hoernschen/dendrite.git
synced 2024-12-26 15:08:28 +00:00
Handle QueryAccountAvailabilityPath in internal user API (#2332)
This commit is contained in:
parent
7499147550
commit
63b7c3da46
1 changed files with 13 additions and 0 deletions
|
@ -369,6 +369,19 @@ func AddRoutes(internalAPIMux *mux.Router, s api.UserInternalAPI) {
|
|||
return util.JSONResponse{Code: http.StatusOK, JSON: &response}
|
||||
}),
|
||||
)
|
||||
internalAPIMux.Handle(QueryAccountAvailabilityPath,
|
||||
httputil.MakeInternalAPI("queryAccountAvailability", func(req *http.Request) util.JSONResponse {
|
||||
request := api.QueryAccountAvailabilityRequest{}
|
||||
response := api.QueryAccountAvailabilityResponse{}
|
||||
if err := json.NewDecoder(req.Body).Decode(&request); err != nil {
|
||||
return util.MessageResponse(http.StatusBadRequest, err.Error())
|
||||
}
|
||||
if err := s.QueryAccountAvailability(req.Context(), &request, &response); err != nil {
|
||||
return util.ErrorResponse(err)
|
||||
}
|
||||
return util.JSONResponse{Code: http.StatusOK, JSON: &response}
|
||||
}),
|
||||
)
|
||||
internalAPIMux.Handle(QueryAccountByPasswordPath,
|
||||
httputil.MakeInternalAPI("queryAccountByPassword", func(req *http.Request) util.JSONResponse {
|
||||
request := api.QueryAccountByPasswordRequest{}
|
||||
|
|
Loading…
Reference in a new issue