mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-11 16:13:10 -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),
|
||||
"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 {
|
||||
return util.MatrixErrorResponse(
|
||||
http.StatusInternalServerError,
|
||||
|
|
@ -104,8 +106,8 @@ func AdminCreateNewRegistrationToken(req *http.Request, cfg *config.ClientAPI, r
|
|||
JSON: map[string]interface{}{
|
||||
"token": token,
|
||||
"uses_allowed": usesAllowed,
|
||||
"pending": 0,
|
||||
"completed": 0,
|
||||
"pending": pending,
|
||||
"completed": completed,
|
||||
"expiry_time": expiryTime,
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue