import { apiFetch } from "./client";
import type {
  PagedSearchResponse,
  SearchRequest,
  ServiceItem,
} from "../types/search";

export const search = (req: SearchRequest) =>
  apiFetch<PagedSearchResponse<ServiceItem>>("/search", {
    method: "POST",
    body: JSON.stringify(req),
  });
