fix: use queueForEvents in users
This commit is contained in:
parent
1343d4851a
commit
a67ca55af5
2 changed files with 5 additions and 5 deletions
|
@ -1098,8 +1098,8 @@ App::post('/v1/users/:userId/tokens')
|
|||
->param('userId', '', new UID(), 'User ID.')
|
||||
->inject('response')
|
||||
->inject('dbForProject')
|
||||
->inject('events')
|
||||
->action(function (string $userId, Response $response, Database $dbForProject, Event $events) {
|
||||
->inject('queueForEvents')
|
||||
->action(function (string $userId, Response $response, Database $dbForProject, Event $queueForEvents) {
|
||||
$user = $dbForProject->getDocument('users', $userId);
|
||||
|
||||
if ($user->isEmpty()) {
|
||||
|
@ -1125,7 +1125,7 @@ App::post('/v1/users/:userId/tokens')
|
|||
|
||||
$token->setAttribute('secret', $secret);
|
||||
|
||||
$events
|
||||
$queueForEvents
|
||||
->setParam('userId', $user->getId())
|
||||
->setParam('tokenId', $token->getId())
|
||||
->setPayload($response->output($token, Response::MODEL_TOKEN));
|
||||
|
|
|
@ -241,8 +241,8 @@ trait UsersBase
|
|||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
], $this->getHeaders()));
|
||||
|
||||
$this->assertEquals($token['headers']['status-code'], 201);
|
||||
$this->assertEquals($token['body']['userId'], $data['userId']);
|
||||
$this->assertEquals(201, $token['headers']['status-code']);
|
||||
$this->assertEquals($data['userId'], $token['body']['userId']);
|
||||
$this->assertNotEmpty($token['body']['secret']);
|
||||
$this->assertNotEmpty($token['body']['expire']);
|
||||
|
||||
|
|
Loading…
Reference in a new issue