@@ -16,7 +16,9 @@ const mapStateToProps = createStructuredSelector({
|
||||
|
||||
export function TechClockInComponent({ form, bodyshop, technician }) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const emps = bodyshop.employees.filter((e) => e.id === technician.id)[0];
|
||||
|
||||
return (
|
||||
<div>
|
||||
<LayoutFormRow grow noDivider>
|
||||
|
||||
@@ -46,6 +46,16 @@ export function TechClockInContainer({
|
||||
(e) => e.id === (technician && technician.id)
|
||||
)[0];
|
||||
|
||||
const TechForm = () => {
|
||||
if (technician) {
|
||||
return <Form form={form} layout="vertical" onFinish={handleFinish} >
|
||||
<TechClockInComponent form={form} />
|
||||
</Form>
|
||||
} else {
|
||||
return <div />
|
||||
}
|
||||
}
|
||||
|
||||
const handleFinish = async (values) => {
|
||||
setLoading(true);
|
||||
const theTime = (await axios.post("/utils/time")).data;
|
||||
@@ -146,9 +156,7 @@ export function TechClockInContainer({
|
||||
</Space>
|
||||
}
|
||||
>
|
||||
<Form form={form} layout="vertical" onFinish={handleFinish}>
|
||||
<TechClockInComponent form={form} />
|
||||
</Form>
|
||||
<TechForm />
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user