import "server-only"; import { winofyFetch, type PaginatedResponse } from "./winofy"; import type { StoreCategory, StoreDetail, StoreListItem } from "@/types/api"; export async function getStoreCategories(): Promise { const res = await winofyFetch>("/v1/store-categories/", { auth: false, params: { limit: 100 }, }); return res.results; } export interface GetStoresParams { category?: string; search?: string; neighborhood?: string; lat?: number; lng?: number; limit?: number; } export async function getStores(params: GetStoresParams = {}): Promise { const res = await winofyFetch>("/v1/stores/", { auth: false, params: { limit: 20, ...params }, }); return res.results; } export async function getStore(uuid: string): Promise { return winofyFetch(`/v1/stores/${uuid}/`, { auth: false }); }