Skip to content

Commit

Permalink
chore(logic): redirect instead of throw error
Browse files Browse the repository at this point in the history
  • Loading branch information
emilielr committed Jun 11, 2024
1 parent cbb0e19 commit 11e31ff
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions next-tavla/app/(admin)/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,7 @@ export async function getPrivateBoardsForUser() {

export async function getAllBoardsForUser() {
const user = await getUser()
if (!user)
throw new TavlaError({
code: 'NOT_FOUND',
message: `Found no user`,
})
if (!user) return redirect('/')

const privateBoardIDs = concat(user.owner ?? [], user.editor ?? [])

Expand Down

0 comments on commit 11e31ff

Please sign in to comment.