Skip to content

Commit

Permalink
Project: accept .json ending in export
Browse files Browse the repository at this point in the history
  • Loading branch information
JohannaPeanut committed Feb 5, 2025
1 parent 7980f94 commit 3f70768
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/app/api/projects/[slug]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ const corsHeaders = {

export async function GET(request: Request, { params }: { params: Promise<{ slug: string }> }) {
try {
const slug = (await params).slug
let slug = (await params).slug

if (slug.endsWith(".json")) {
slug = slug.replace(/\.json$/, "")
}

const project = await db.project.findFirst({
where: { slug },
select: {
Expand Down

0 comments on commit 3f70768

Please sign in to comment.