import saveFile from "./saveFile";
export default async function downloadCSV({ limit, filename, collection, filters, }, { db }) {
  const { data } = (await db.call("exportCsv")({
    data: {
      limit,
      filename,
      collection,
      filters,
    },
  }));
  saveFile({
    filename,
    data,
  });
  return data;
}
