IO-1176 Move duplication totals to server side.
This commit is contained in:
@@ -39,24 +39,20 @@ export default async function DuplicateJob(
|
|||||||
line.manual_line = true;
|
line.manual_line = true;
|
||||||
});
|
});
|
||||||
newJob.joblines = keepJobLines ? _tempLines : [];
|
newJob.joblines = keepJobLines ? _tempLines : [];
|
||||||
newJob.job_totals = (
|
|
||||||
await Axios.post("/job/totals", {
|
|
||||||
job: newJob,
|
|
||||||
})
|
|
||||||
).data;
|
|
||||||
|
|
||||||
delete newJob.joblines;
|
delete newJob.joblines;
|
||||||
newJob.joblines = keepJobLines ? { data: _tempLines } : null;
|
newJob.joblines = keepJobLines ? { data: _tempLines } : null;
|
||||||
|
|
||||||
apolloClient
|
const res2 = await apolloClient.mutate({
|
||||||
.mutate({
|
mutation: INSERT_NEW_JOB,
|
||||||
mutation: INSERT_NEW_JOB,
|
variables: { job: [newJob] },
|
||||||
variables: { job: [newJob] },
|
});
|
||||||
})
|
await Axios.post("/job/totalsssu", {
|
||||||
.then((res2) => {
|
id: res2.data.insert_jobs.returning[0].id,
|
||||||
if (completionCallback)
|
});
|
||||||
completionCallback(res2.data.insert_jobs.returning[0].id);
|
|
||||||
});
|
if (completionCallback)
|
||||||
|
completionCallback(res2.data.insert_jobs.returning[0].id);
|
||||||
|
|
||||||
//insert the new job. call the callback with the returned ID when done.
|
//insert the new job. call the callback with the returned ID when done.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user