refactoring: invoice form.

refactoring: receipt form.
refactoring: bill form.
refactoring: estimate form.
This commit is contained in:
a.bouhuolia
2021-02-15 16:23:58 +02:00
parent 151bd9bc54
commit e8458e2b36
37 changed files with 410 additions and 903 deletions

View File

@@ -31,12 +31,12 @@ function EstimateDeleteAlert({
const { mutateAsync: deleteEstimateMutate, isLoading } = useDeleteEstimate();
// handle cancel delete alert.
const handleCancelEstimateDelete = () => {
const handleAlertCancel = () => {
closeAlert(name);
};
// handle confirm delete estimate
const handleConfirmEstimateDelete = useCallback(() => {
const handleAlertConfirm = () => {
deleteEstimateMutate(estimateId)
.then(() => {
AppToaster.show({
@@ -50,7 +50,7 @@ function EstimateDeleteAlert({
.finally(() => {
closeAlert(name);
});
}, [deleteEstimateMutate, name, closeAlert, formatMessage, estimateId]);
};
return (
<Alert
@@ -60,8 +60,8 @@ function EstimateDeleteAlert({
intent={Intent.DANGER}
isOpen={isOpen}
loading={isLoading}
onCancel={handleCancelEstimateDelete}
onConfirm={handleConfirmEstimateDelete}
onCancel={handleAlertCancel}
onConfirm={handleAlertConfirm}
>
<p>
<FormattedHTMLMessage