IO-2038 Resolve duplicate shift clock login.

This commit is contained in:
Patrick Fic
2022-10-18 09:51:55 -07:00
parent b363b2f7e5
commit c83ff03ae8
6 changed files with 72 additions and 27 deletions

View File

@@ -64,6 +64,12 @@ export function TimeTicketShiftContainer({
</div>
);
const checkIfAlreadyClocked = async () => {
const { data } = await refetch();
return data.timetickets.length > 0;
};
return (
<div>
{data.timetickets.length > 0 ? (
@@ -72,7 +78,10 @@ export function TimeTicketShiftContainer({
refetch={refetch}
/>
) : (
<TimeTicketShiftFormContainer isTechConsole={isTechConsole} />
<TimeTicketShiftFormContainer
isTechConsole={isTechConsole}
checkIfAlreadyClocked={checkIfAlreadyClocked}
/>
)}
</div>
);