import api from "src/api";

export const dadosDashboard = async () => {
  const { data } = await api.get("/dados-dashboard-cliente");
  return data.payload;
}

export const getScheduleClienteDetails = async (id) => {
  const { data } = await api.get(`/dados-dashboard-cliente/schedule/${id}/detalhes`);
  return data.payload;
}

export const buscaPrestadores = async ({ name = '', date = '' } = {}) => {
  const params = {};
  if (name) params.name = name;
  if (date) params.date = date;
  const { data } = await api.get('/prestadores-busca', { params });
  return data.payload;
}