Fixed test and PDO error
This commit is contained in:
parent
2028d334a2
commit
5fa2a8468e
3 changed files with 4 additions and 3 deletions
|
@ -602,7 +602,7 @@ App::post('/v1/account/sessions/anonymous')
|
||||||
throw new Exception('Failed to create anonymous user.', 401);
|
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);
|
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());
|
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
|
$audits
|
||||||
->setParam('userId', $user->getId())
|
->setParam('userId', $user->getId())
|
||||||
|
|
|
@ -456,7 +456,6 @@ App::get('/v1/teams/:teamId/memberships')
|
||||||
]), Response::MODEL_MEMBERSHIP_LIST);
|
]), Response::MODEL_MEMBERSHIP_LIST);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
App::patch('/v1/teams/:teamId/memberships/:membershipId')
|
App::patch('/v1/teams/:teamId/memberships/:membershipId')
|
||||||
->desc('Update Membership Roles')
|
->desc('Update Membership Roles')
|
||||||
->groups(['api', 'teams'])
|
->groups(['api', 'teams'])
|
||||||
|
|
|
@ -77,6 +77,7 @@ class PDO extends PDONative
|
||||||
$result = $this->pdo->rollBack();
|
$result = $this->pdo->rollBack();
|
||||||
} catch (\Throwable $th) {
|
} catch (\Throwable $th) {
|
||||||
$this->pdo = $this->reconnect();
|
$this->pdo = $this->reconnect();
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
|
|
Loading…
Reference in a new issue