diff --git a/src/components/BillSearcher.js b/src/components/BillSearcher.js index 6b1ad52..3a973c3 100644 --- a/src/components/BillSearcher.js +++ b/src/components/BillSearcher.js @@ -3,7 +3,7 @@ import { bindActionCreators } from "redux"; import { connect } from "react-redux"; import { injectIntl } from "react-intl"; -import { IconButton, Tooltip, Button, Dialog, DialogActions, DialogTitle } from "@material-ui/core"; +import { IconButton, Tooltip, Button, Dialog, DialogActions, DialogTitle, DialogContent } from "@material-ui/core"; import EditIcon from "@material-ui/icons/Edit"; import DeleteIcon from "@material-ui/icons/Delete"; @@ -72,13 +72,17 @@ const BillSearcher = ({ }, [confirmed]); useEffect(() => { - setFailedExport(true); + if (errorBillsExport) { + setFailedExport(true); + } }, [errorBillsExport]); useEffect(() => { if (billsExport) { downloadExport(billsExport, "bill_export.csv")(); } + + return setFailedExport(false); }, [billsExport]); useEffect(() => { @@ -250,12 +254,15 @@ const BillSearcher = ({ "status": "Status", }} /> - {failedExport && ( - - {errorBillsExport} + + {errorBillsExport?.message} + + {`${errorBillsExport?.code}: `} + {errorBillsExport?.detail} + -