mirror of
https://github.com/element-hq/dendrite.git
synced 2025-09-14 13:22:26 +03:00
mas: TestAdminUserDevicesDelete
This commit is contained in:
parent
f1de5aa838
commit
0db7647f46
2 changed files with 108 additions and 2 deletions
|
@ -720,11 +720,13 @@ func AdminUserDevicesDelete(
|
|||
}
|
||||
userID := vars["userID"]
|
||||
|
||||
if req.Body == nil {
|
||||
return util.MessageResponse(http.StatusBadRequest, "body is required")
|
||||
}
|
||||
var payload struct {
|
||||
Devices []string `json:"devices"`
|
||||
}
|
||||
|
||||
defer req.Body.Close() // nolint: errcheck
|
||||
if err = json.NewDecoder(req.Body).Decode(&payload); err != nil {
|
||||
logger.WithError(err).Error("unable to decode device deletion request")
|
||||
return util.JSONResponse{
|
||||
|
@ -732,6 +734,7 @@ func AdminUserDevicesDelete(
|
|||
JSON: spec.InternalServerError{},
|
||||
}
|
||||
}
|
||||
defer req.Body.Close() // nolint: errcheck
|
||||
|
||||
{
|
||||
// XXX: this response struct can completely removed everywhere as it doesn't
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue