Skip to content

Commit

Permalink
fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
VictorVation committed May 19, 2023
1 parent e5e5a1c commit a047420
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions app/(introducty)/api/sites/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,17 @@ export async function POST(req: Request) {
style: "capital",
separator: "",
});
const { site, error: insertError } = await supabase.from("sites").insert({
site_name: siteName,
creator_id: authUser.id,
design: null,
});
const { data: site, error: insertError } = await supabase
.from("sites")
.insert({
site_name: siteName,
creator_id: authUser.id,
design: null,
});

console.log(insertError);
if (insertError) {
return new Response(insertError.message, { status: 500 });
}

return new Response(JSON.stringify(site));
} catch (error) {
Expand Down

1 comment on commit a047420

@vercel
Copy link

@vercel vercel bot commented on a047420 May 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.