feat(catalog): fetch players, services, shops

This commit is contained in:
zetaloop
2026-02-28 16:37:15 +08:00
parent f4365668ab
commit f1ae3e04bb
11 changed files with 234 additions and 57 deletions
+3 -3
View File
@@ -16,15 +16,15 @@ interface PageProps {
export default async function ShopPage({ params }: PageProps) {
const { id } = await params
const shop = getShopById(id)
const shop = await getShopById(id)
if (!shop) {
notFound()
}
const shopPlayers = listPlayersByShop(shop.id)
const [shopPlayers, allServices] = await Promise.all([listPlayersByShop(shop.id), listServices()])
const playerIds = shopPlayers.map((p) => p.id)
const shopServices = listServices().filter((s) => playerIds.includes(s.playerId))
const shopServices = allServices.filter((s) => playerIds.includes(s.playerId))
const shopReviews = listReviews().filter((r) => playerIds.includes(r.toUserId))
const sortedSections = [...shop.templateConfig.sections]
.filter((s) => s.enabled)