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

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

export const syncVectorData = (req: SyncRequest) =>
  apiFetch<Object>("/sync", { method: "POST", body: JSON.stringify(req) });
