File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,9 +12,9 @@ import { cache } from "react";
1212export async function generateMetadata ( {
1313 params,
1414} : {
15- params : { id : string } ;
15+ params : Promise < { id : string } > ;
1616} ) : Promise < Metadata > {
17- const generatedApp = await getGeneratedAppByID ( params . id ) ;
17+ const generatedApp = await getGeneratedAppByID ( ( await params ) . id ) ;
1818
1919 let prompt = generatedApp ?. prompt ;
2020 if ( typeof prompt !== "string" ) {
@@ -33,13 +33,18 @@ export async function generateMetadata({
3333 } ;
3434}
3535
36- export default async function Page ( { params } : { params : { id : string } } ) {
36+ export default async function Page ( {
37+ params,
38+ } : {
39+ params : Promise < { id : string } > ;
40+ } ) {
41+ const { id } = await params ;
3742 // if process.env.DATABASE_URL is not set, throw an error
38- if ( typeof params . id !== "string" ) {
43+ if ( typeof id !== "string" ) {
3944 notFound ( ) ;
4045 }
4146
42- const generatedApp = await getGeneratedAppByID ( params . id ) ;
47+ const generatedApp = await getGeneratedAppByID ( id ) ;
4348
4449 if ( ! generatedApp ) {
4550 return < div > App not found</ div > ;
You can’t perform that action at this time.
0 commit comments