diff --git a/client/src/components/production-list-columns/production-list-columns.empassignment.component.jsx b/client/src/components/production-list-columns/production-list-columns.empassignment.component.jsx index c02f46fa6..704d48432 100644 --- a/client/src/components/production-list-columns/production-list-columns.empassignment.component.jsx +++ b/client/src/components/production-list-columns/production-list-columns.empassignment.component.jsx @@ -35,8 +35,6 @@ export function ProductionListEmpAssignment({ insertAuditTrail, bodyshop, record const result = await updateJob({ variables: { jobId: record.id, job: { [empAssignment]: employeeid } } - - // awaitRefetchQueries: true, }); insertAuditTrail({ @@ -55,6 +53,7 @@ export function ProductionListEmpAssignment({ insertAuditTrail, bodyshop, record await refetch(); + setAssignment({ operation: null, employeeid: null }); setLoading(false); }; const handleRemove = async (operation) => { @@ -84,6 +83,7 @@ export function ProductionListEmpAssignment({ insertAuditTrail, bodyshop, record await refetch(); + setAssignment({ operation: null, employeeid: null }); setLoading(false); }; @@ -115,6 +115,7 @@ export function ProductionListEmpAssignment({ insertAuditTrail, bodyshop, record filterOption: (input, option) => option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 }} style={{ width: 200 }} + value={assignment.employeeid} onChange={onChange} options={employeeOptions} /> @@ -142,25 +143,25 @@ export function ProductionListEmpAssignment({ insertAuditTrail, bodyshop, record if (record[type]) theEmployee = bodyshop.employees.find((e) => e.id === record[type]); return ( - - - {record[type] ? ( -
- {`${theEmployee?.first_name || ""} ${theEmployee?.last_name || ""}`} - handleRemove(type)} /> -
- ) : ( + + {record[type] ? ( +
+ {`${theEmployee?.first_name || ""} ${theEmployee?.last_name || ""}`} + handleRemove(type)} /> +
+ ) : ( + { - setAssignment({ operation: type }); + setAssignment({ operation: type, employeeid: null }); setVisibility(true); }} /> - )} -
-
+ + )} + ); }