mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-15 01:53:09 -06:00
refactoring
This commit is contained in:
parent
6205ffb8c0
commit
f5039be461
|
|
@ -85,7 +85,9 @@ func AdminCreateNewRegistrationToken(req *http.Request, cfg *config.ClientAPI, r
|
||||||
string(spec.ErrorInvalidParam),
|
string(spec.ErrorInvalidParam),
|
||||||
"expiry_time must not be in the past")
|
"expiry_time must not be in the past")
|
||||||
}
|
}
|
||||||
created, err := rsAPI.PerformCreateToken(req.Context(), token, usesAllowed, expiryTime)
|
pending := 0
|
||||||
|
completed := 0
|
||||||
|
created, err := rsAPI.PerformAdminCreateRegistrationToken(req.Context(), token, usesAllowed, int32(pending), int32(completed), expiryTime)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return util.MatrixErrorResponse(
|
return util.MatrixErrorResponse(
|
||||||
http.StatusInternalServerError,
|
http.StatusInternalServerError,
|
||||||
|
|
@ -104,8 +106,8 @@ func AdminCreateNewRegistrationToken(req *http.Request, cfg *config.ClientAPI, r
|
||||||
JSON: map[string]interface{}{
|
JSON: map[string]interface{}{
|
||||||
"token": token,
|
"token": token,
|
||||||
"uses_allowed": usesAllowed,
|
"uses_allowed": usesAllowed,
|
||||||
"pending": 0,
|
"pending": pending,
|
||||||
"completed": 0,
|
"completed": completed,
|
||||||
"expiry_time": expiryTime,
|
"expiry_time": expiryTime,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue