Resolve time ticket posting issue.

This commit is contained in:
Patrick Fic
2023-04-05 14:02:34 -07:00
parent 6e7d1abd70
commit 8a6d94f193
3 changed files with 16 additions and 1 deletions

View File

@@ -26,6 +26,10 @@ export function TechClockInContainer({
technician,
bodyshop,
}) {
console.log(
"🚀 ~ file: tech-job-clock-in-form.container.jsx:29 ~ technician:",
technician
);
const [form] = Form.useForm();
const [loading, setLoading] = useState(false);
const [insertTimeTicket] = useMutation(INSERT_NEW_TIME_TICKET, {
@@ -33,6 +37,10 @@ export function TechClockInContainer({
});
const { t } = useTranslation();
const emps = bodyshop.employees.filter(
(e) => e.id === (technician && technician.id)
)[0];
const handleFinish = async (values) => {
setLoading(true);
const theTime = (await axios.post("/utils/time")).data;
@@ -87,7 +95,12 @@ export function TechClockInContainer({
onClick={() => {
setTimeTicketContext({
actions: {},
context: { timeticket: { employeeid: technician.id } },
context: {
timeticket: {
employeeid: technician.id,
flat_rate: emps.flat_rate,
},
},
});
}}
>