mirror of
https://github.com/element-hq/dendrite.git
synced 2025-09-14 13:22:26 +03:00
mas: implemented PUT /admin/v2/users/{userID} endpoint
MAS requires this endpoint to fetch the data for the account management page
This commit is contained in:
parent
9ebcebee43
commit
be8d490e56
5 changed files with 95 additions and 12 deletions
|
@ -344,9 +344,16 @@ func Setup(
|
|||
})).Methods(http.MethodGet)
|
||||
|
||||
synapseAdminRouter.Handle("/admin/v2/users/{userID}",
|
||||
httputil.MakeServiceAdminAPI("admin_provision_user", m.AdminToken, func(r *http.Request) util.JSONResponse {
|
||||
return AdminCreateOrModifyAccount(r, userAPI)
|
||||
})).Methods(http.MethodPut)
|
||||
httputil.MakeServiceAdminAPI("admin_manage_user", m.AdminToken, func(r *http.Request) util.JSONResponse {
|
||||
switch r.Method {
|
||||
case http.MethodGet:
|
||||
return AdminRetrieveAccount(r, cfg, userAPI)
|
||||
case http.MethodPut:
|
||||
return AdminCreateOrModifyAccount(r, userAPI)
|
||||
default:
|
||||
return util.JSONResponse{Code: http.StatusMethodNotAllowed, JSON: nil}
|
||||
}
|
||||
})).Methods(http.MethodPut, http.MethodGet)
|
||||
|
||||
synapseAdminRouter.Handle("/admin/v2/users/{userID}/devices",
|
||||
httputil.MakeServiceAdminAPI("admin_user_devices", m.AdminToken, func(r *http.Request) util.JSONResponse {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue