feature/IO-3255-simplified-parts-management - Bug Fixes

This commit is contained in:
Dave
2025-08-15 13:20:17 -04:00
parent 5e90504e56
commit cc232eac93
2 changed files with 46 additions and 40 deletions

View File

@@ -322,19 +322,17 @@ export function JobLinesComponent({
render: (text, record) => (
<Space>
{(record.manual_line || jobIsPrivate) && !technician && (
<>
<Button
disabled={jobRO}
onClick={() => {
setJobLineEditContext({
actions: { refetch: refetch, submit: form && form.submit },
context: { ...record, jobid: job.id }
});
}}
>
<EditFilled />
</Button>
</>
<Button
disabled={jobRO}
onClick={() => {
setJobLineEditContext({
actions: { refetch: refetch, submit: form && form.submit },
context: { ...record, jobid: job.id }
});
}}
>
<EditFilled />
</Button>
)}
<Button
title={t("tasks.buttons.create")}
@@ -350,31 +348,29 @@ export function JobLinesComponent({
<FaTasks />
</Button>
{(record.manual_line || jobIsPrivate) && !technician && (
<>
<Button
disabled={jobRO}
onClick={async () => {
await deleteJobLine({
variables: { joblineId: record.id },
update(cache) {
cache.modify({
fields: {
joblines(existingJobLines, { readField }) {
return existingJobLines.filter((jlRef) => record.id !== readField("id", jlRef));
}
<Button
disabled={jobRO}
onClick={async () => {
await deleteJobLine({
variables: { joblineId: record.id },
update(cache) {
cache.modify({
fields: {
joblines(existingJobLines, { readField }) {
return existingJobLines.filter((jlRef) => record.id !== readField("id", jlRef));
}
});
}
});
await axios.post("/job/totalsssu", {
id: job.id
});
refetch && refetch();
}}
>
<DeleteFilled />
</Button>
</>
}
});
}
});
await axios.post("/job/totalsssu", {
id: job.id
});
if (refetch) refetch();
}}
>
<DeleteFilled />
</Button>
)}
</Space>
)