Handle API error in team account retrieval
This update adds error handling for the API call in 'join' page while retrieving the team account information. If the call fails, it will catch the error and return undefined avoiding potential crashes.
This commit is contained in:
@@ -70,7 +70,9 @@ async function JoinTeamAccountPage({ searchParams }: Context) {
|
||||
// we need to verify the user isn't already in the account
|
||||
// we do so by checking if the user can read the account
|
||||
// if the user can read the account, then they are already in the account
|
||||
const account = await api.getTeamAccountById(invitation.account.id);
|
||||
const account = await api
|
||||
.getTeamAccountById(invitation.account.id)
|
||||
.catch(() => undefined);
|
||||
|
||||
// if the user is already in the account redirect to the home page
|
||||
if (account) {
|
||||
|
||||
Reference in New Issue
Block a user