Skip to content

Commit

Permalink
fix: 🐛 Fixed route type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
adevinwild committed Mar 21, 2024
1 parent 55efb44 commit c77a5ac
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/app/api/predictions/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ export async function POST(req: NextRequest) {
const predictionId = searchParams.get("id");

if (!predictionId) {
return {
status: 400,
body: "An error has occured.",
};
return NextResponse.json(
{ error: "Missing prediction ID" },
{ status: 400 }
);
}

const supabase = await createSupabaseServerClient();
Expand All @@ -20,10 +20,7 @@ export async function POST(req: NextRequest) {
.single();

if (error) {
return {
status: 500,
body: error.message,
};
return NextResponse.json({ error: error.message }, { status: 500 });
}

return NextResponse.json({ prediction: data });
Expand Down

0 comments on commit c77a5ac

Please sign in to comment.