Files
juwan-frontend/lib/domain/resolve-current-shop.ts
T

7 lines
225 B
TypeScript

import type { Shop } from "@/lib/types"
export function resolveOwnerShop(userId: string | undefined, shops: Shop[]): Shop | null {
if (!userId) return null
return shops.find((shop) => shop.owner.id === userId) ?? null
}