import "server-only"; import { winofyFetch, type PaginatedResponse } from "./winofy"; import type { City, Neighborhood } from "@/types/api"; export async function getCities(): Promise { const res = await winofyFetch>("/v1/cities/", { auth: false, params: { limit: 100 } }); return res.results; } export async function getCity(uuid: string): Promise { return winofyFetch(`/v1/cities/${uuid}/`, { auth: false }); } export async function getNeighborhoods(params: { city?: string; limit?: number } = {}): Promise { const res = await winofyFetch>("/v1/neighborhoods/", { auth: false, params: { limit: 200, ...params }, }); return res.results; } export async function getNeighborhood(uuid: string): Promise { return winofyFetch(`/v1/neighborhoods/${uuid}/`, { auth: false }); }