Hanzo Dev commited on
Commit
e835a44
·
1 Parent(s): eba98a4

Fix download route params for Next.js 15 - must await params

Browse files
app/api/download/[template]/route.ts CHANGED
@@ -7,10 +7,10 @@ import { readdir, stat } from 'fs/promises'
7
 
8
  export async function GET(
9
  request: NextRequest,
10
- { params }: { params: { template: string } }
11
  ) {
12
  try {
13
- const templateId = params.template
14
  const template = templates.find(t => t.id === templateId)
15
 
16
  if (!template || !template.downloadable) {
 
7
 
8
  export async function GET(
9
  request: NextRequest,
10
+ { params }: { params: Promise<{ template: string }> }
11
  ) {
12
  try {
13
+ const { template: templateId } = await params
14
  const template = templates.find(t => t.id === templateId)
15
 
16
  if (!template || !template.downloadable) {