Skip to content

Commit

Permalink
prevent error during build if not specified database
Browse files Browse the repository at this point in the history
  • Loading branch information
invisal committed Aug 24, 2024
1 parent ab8ebbe commit ba9d3b4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/app/(public)/login/github/callback/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ export async function GET(request: Request): Promise<Response> {
},
});
} catch (e) {
console.error(e);
// the specific error message depends on the provider
if (e instanceof OAuth2RequestError) {
// invalid code
Expand Down
10 changes: 8 additions & 2 deletions src/app/(public)/playground/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,14 @@ export const metadata: Metadata = {
};

export default async function PlaygroundPage() {
const db = get_database();
const templateList = await db.select().from(dbDataset);
let templateList: (typeof dbDataset.$inferSelect)[] = [];

try {
const db = get_database();
templateList = await db.select().from(dbDataset);
} catch {
templateList = [];
}

return (
<WebsiteLayout>
Expand Down

0 comments on commit ba9d3b4

Please sign in to comment.