Files
juwan-frontend/lib/api/shops.ts
T

14 lines
376 B
TypeScript

import { useShopStore } from "@/store/shops"
export function listShops() {
return useShopStore.getState().shops
}
export function getShopById(shopId: string) {
return useShopStore.getState().shops.find((shop) => shop.id === shopId)
}
export function getShopByOwnerId(ownerId: string) {
return useShopStore.getState().shops.find((shop) => shop.owner.id === ownerId)
}