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;
|
||||
});
|
||||
newJob.joblines = keepJobLines ? _tempLines : [];
|
||||
newJob.job_totals = (
|
||||
await Axios.post("/job/totals", {
|
||||
job: newJob,
|
||||
})
|
||||
).data;
|
||||
|
||||
delete newJob.joblines;
|
||||
newJob.joblines = keepJobLines ? { data: _tempLines } : null;
|
||||
|
||||
apolloClient
|
||||
.mutate({
|
||||
mutation: INSERT_NEW_JOB,
|
||||
variables: { job: [newJob] },
|
||||
})
|
||||
.then((res2) => {
|
||||
if (completionCallback)
|
||||
completionCallback(res2.data.insert_jobs.returning[0].id);
|
||||
});
|
||||
const res2 = await apolloClient.mutate({
|
||||
mutation: INSERT_NEW_JOB,
|
||||
variables: { job: [newJob] },
|
||||
});
|
||||
await Axios.post("/job/totalsssu", {
|
||||
id: 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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user