import api from "src/api";

export const getFranchisorDashboard = async (unitIds = [], period = {}) => {
  const { data } = await api.get("/franchisor-dashboard/overview", {
    params: {
      ...(unitIds.length ? { unit_ids: unitIds } : {}),
      ...(period.startDate ? { start_date: period.startDate } : {}),
      ...(period.endDate ? { end_date: period.endDate } : {}),
    },
  });
  return data.payload;
};
