Added server side job calculation. BOD-267

This commit is contained in:
Patrick Fic
2020-08-21 15:48:48 -07:00
parent 488e316550
commit 4a92ef03cc
6 changed files with 362 additions and 7 deletions

View File

@@ -26,6 +26,20 @@ export function JobsTotalsTableComponent({ bodyshop, job }) {
setTotals(CalculateJob(job, bodyshop.shoprates));
}, [bodyshop, job]);
// useEffect(() => {
// const Calculate = async () => {
// const newTotals = (
// await Axios.post("/job/totals", {
// job: job,
// shoprates: bodyshop.shoprates,
// })
// ).data;
// setTotals(newTotals);
// };
// Calculate();
// }, [bodyshop, job]);
if (!!!totals) {
return <LoadingSkeleton />;
}

View File

@@ -30,6 +30,7 @@ export function JobsDetailHeader({
bodyshop,
updateJobStatus,
setScheduleContext,
loading,
form,
}) {
const { t } = useTranslation();
@@ -79,6 +80,7 @@ export function JobsDetailHeader({
<JobsDetailHeaderActions key="actions" job={job} refetch={refetch} />
<Button
type="primary"
loading={loading}
className="imex-flex-row__margin"
onClick={() => form.submit()}
>