1
0
Fork 0
mirror of synced 2024-10-02 10:16:27 +13:00

fix: use queueForEvents in users

This commit is contained in:
loks0n 2023-10-23 11:32:09 +01:00
parent 1343d4851a
commit a67ca55af5
2 changed files with 5 additions and 5 deletions

View file

@ -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));

View file

@ -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']);