Skip to content

Commit

Permalink
Merge pull request #19 from canopas/deploy-website-using-s3
Browse files Browse the repository at this point in the history
Show latest dish on home screen
  • Loading branch information
cp-dharti-r authored May 24, 2024
2 parents 11d3a75 + 681e35b commit 95f6fad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions website/store/category/slice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,20 @@ export const getItemCardData = async () => {
if (menuError) return { data: null, error: menuError };

// Extract menu IDs
const menuIds = menusData.map((menu) => menu.id);
const menuIds = menusData.map((menu: any) => menu.id);

// Fetch dishes associated with the obtained menu IDs
const { data: dishesData, error: dishesError } = await supabase
.from("dishes")
.select("*, menus(id, restaurants(id, name, address))")
.in("menu_id", menuIds)
.order("id", { ascending: true })
.order("id", { ascending: false })
.limit(9);

if (dishesError) return { data: null, error: dishesError };

const restaurant = await Promise.all(
dishesData.map(async (dish) => {
dishesData.map(async (dish: any) => {
return {
...dish,
image: dish.images ? dish.images[0] : "",
Expand All @@ -89,7 +89,7 @@ export const getYouMayLikeData = async () => {
.select("*")
.eq("is_public", true)
.order("id", { ascending: true })
.limit(4);
.limit(6);

if (error) return { data: null, error };

Expand All @@ -116,7 +116,7 @@ export const getCategoriesData = async (suffix: any) => {
if (categoriesError) return { data: null, error: categoriesError };

const restaurant = await Promise.all(
categoryDatas.map(async (category) => {
categoryDatas.map(async (category: any) => {
const { data: restaurantData, error: restaurantError } = await supabase
.from("restaurants")
.select("id, name, address")
Expand Down
2 changes: 1 addition & 1 deletion website/store/restaurant/slice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const getDishesData = async (suffix: any) => {
if (error) return { data: null, error };

const dishes = await Promise.all(
menusData.map(async (menu) => {
menusData.map(async (menu: any) => {
const { data: dishData, error: dishError } = await supabase
.from("dishes")
.select(
Expand Down

0 comments on commit 95f6fad

Please sign in to comment.