import { publicApi } from "./publicClient";

export async function getChoices(queries: {
  model: string;
  field: string;
  lang?: string;
}[]) {
  const params = new URLSearchParams();

  queries.forEach((q) => {
    params.append("model", q.model);
    params.append("field", q.field);
    if (q.lang) params.append("lang", q.lang);
  });

  const { data } = await publicApi.get(`/choices/?${params.toString()}`);
  return data; // typ: Array<{ value: string; label: string }>
}