-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
13f023e
commit d006a8f
Showing
4 changed files
with
24 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,24 @@ | ||
import supabase from "@/utils/supabase"; | ||
import Menu from "./menu"; | ||
|
||
const RestaurantMenuDetails = ({ | ||
params, | ||
}: { | ||
params: { restaurant: number }; | ||
params: { restaurant: string }; | ||
}) => { | ||
return <Menu paramsData={params}></Menu>; | ||
}; | ||
|
||
export default RestaurantMenuDetails; | ||
|
||
export async function generateStaticParams() { | ||
return [{ restaurant: "1" }, { restaurant: "2" }, { restaurant: "3" }]; | ||
const { data, error } = await supabase.from("restaurants").select("id"); | ||
if (error) throw error; | ||
|
||
const pagesParams: any[] = []; | ||
for (var i = 0; i < data.length; i++) { | ||
pagesParams.push({ restaurant: data[i].id.toString() }); | ||
} | ||
|
||
return pagesParams; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters