utils/download: take a string instead of AxiosResponse

This commit is contained in:
Alex Gleason
2022-12-17 20:15:03 -06:00
parent 69a9748b3d
commit b15871aaa8
3 changed files with 10 additions and 12 deletions

View File

@ -21,22 +21,22 @@ const Dashboard: React.FC = () => {
const account = useOwnAccount();
const handleSubscribersClick: React.MouseEventHandler = e => {
dispatch(getSubscribersCsv()).then((response) => {
download(response, 'subscribers.csv');
dispatch(getSubscribersCsv()).then(({ data }) => {
download(data, 'subscribers.csv');
}).catch(() => {});
e.preventDefault();
};
const handleUnsubscribersClick: React.MouseEventHandler = e => {
dispatch(getUnsubscribersCsv()).then((response) => {
download(response, 'unsubscribers.csv');
dispatch(getUnsubscribersCsv()).then(({ data }) => {
download(data, 'unsubscribers.csv');
}).catch(() => {});
e.preventDefault();
};
const handleCombinedClick: React.MouseEventHandler = e => {
dispatch(getCombinedCsv()).then((response) => {
download(response, 'combined.csv');
dispatch(getCombinedCsv()).then(({ data }) => {
download(data, 'combined.csv');
}).catch(() => {});
e.preventDefault();
};