atendimentos.js 608 B

12345678910111213141516
  1. import { apiFetch } from "./client.js";
  2. export function sincronizarAtendimentos(params = {}) {
  3. return apiFetch("/api/atendimentos/sync", { method: "POST", body: params });
  4. }
  5. export function listarAtendimentos({ page = 1, pageSize = 20, setor, status } = {}) {
  6. const query = new URLSearchParams({ page: String(page), pageSize: String(pageSize) });
  7. if (setor) query.set("setor", setor);
  8. if (status !== undefined) query.set("status", String(status));
  9. return apiFetch(`/api/atendimentos?${query.toString()}`);
  10. }
  11. export function obterAtendimento(id) {
  12. return apiFetch(`/api/atendimentos/${id}`);
  13. }