1
0
Fork 0
mirror of synced 2024-06-27 02:31:04 +12:00

Fixed test and PDO error

This commit is contained in:
Eldad Fux 2021-06-11 23:39:00 +03:00
parent 2028d334a2
commit 5fa2a8468e
3 changed files with 4 additions and 3 deletions

View file

@ -602,7 +602,7 @@ App::post('/v1/account/sessions/anonymous')
throw new Exception('Failed to create anonymous user.', 401);
}
if ($user->getId()) {
if (!$user->isEmpty()) {
throw new Exception('Cannot create an anonymous user when logged in.', 401);
}
@ -662,7 +662,8 @@ App::post('/v1/account/sessions/anonymous')
Authorization::setRole('user:'.$user->getId());
$user = $dbForInternal->updateDocument('users', $user->getId(), $user);
$user = $dbForInternal->updateDocument('users', $user->getId(),
$user->setAttribute('sessions', $session, Document::SET_TYPE_APPEND));
$audits
->setParam('userId', $user->getId())

View file

@ -456,7 +456,6 @@ App::get('/v1/teams/:teamId/memberships')
]), Response::MODEL_MEMBERSHIP_LIST);
});
App::patch('/v1/teams/:teamId/memberships/:membershipId')
->desc('Update Membership Roles')
->groups(['api', 'teams'])

View file

@ -77,6 +77,7 @@ class PDO extends PDONative
$result = $this->pdo->rollBack();
} catch (\Throwable $th) {
$this->pdo = $this->reconnect();
return false;
}
return $result;