diff --git a/app/(main)/shop/[id]/page.tsx b/app/(main)/shop/[id]/page.tsx index 9474162..7e627c6 100644 --- a/app/(main)/shop/[id]/page.tsx +++ b/app/(main)/shop/[id]/page.tsx @@ -5,7 +5,7 @@ import { Button } from "@/components/ui/button" import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card" import { EmptyState } from "@/components/ui/empty-state" import { Separator } from "@/components/ui/separator" -import { getShopById, listPlayersByShop, listReviews, listServices } from "@/lib/api" +import { getShopById, listPlayersByShop, listReviews } from "@/lib/api" import { getShopSections } from "@/lib/domain/shop-template" import { Gamepad2, Megaphone, ShoppingBag, Star, Users } from "lucide-react" import Image from "next/image" @@ -24,9 +24,8 @@ export default async function ShopPage({ params }: PageProps) { notFound() } - const [shopPlayers, allServices] = await Promise.all([listPlayersByShop(shop.id), listServices()]) - const playerIds = new Set(shopPlayers.map((player) => String(player.id))) - const shopServices = allServices.filter((service) => playerIds.has(String(service.playerId))) + const shopPlayers = await listPlayersByShop(shop.id) + const shopServices = shopPlayers.flatMap((player) => player.services) const shopReviews = await listReviews() const sortedSections = getShopSections(shop).filter((s) => s.enabled)