added refresing of calls for active tickets

This commit is contained in:
jfrye122
2023-05-18 17:25:59 -04:00
parent 3114f2fb23
commit 05e3613db9
5 changed files with 40 additions and 25 deletions

View File

@@ -22,6 +22,7 @@ import axios from "axios";
import { useNavigation } from "@react-navigation/native";
// import { selectCurrentTimeTicketJobId } from "../../redux/timetickets/timetickets.selectors";
import { QUERY_ACTIVE_TIME_TICKETS } from "../../graphql/timetickets.queries";
const mapStateToProps = createStructuredSelector({
currentEmployee: selectCurrentEmployee,
currentRatesNCostCenters: selectRates,
@@ -40,20 +41,20 @@ export function TimeTicketClockOff({
route,
}) {
const navigation = useNavigation();
const { timeTicketId } = route.params;
const { timeTicketId, handleOnDone } = route.params;
// console.log("TimeTicketClockOff, timeTicketId :", timeTicketId);
// console.log( "TimeTicketClockOff, currentTmTicketJobId :", currentTmTicketJobId );
console.log( "TimeTicketClockOff, handleOnDone :", handleOnDone );
const { t } = useTranslation();
const [loading, setLoading] = useState(false);
const [error, setError] = useState(null);
const [currentSCC, setCurrentSCC] = useState(null);
const [updateTimeticket] = useMutation(UPDATE_TIME_TICKET);
const [updateTimeticket] = useMutation(UPDATE_TIME_TICKET,
{refetchQueries: ["QUERY_ACTIVE_TIME_TICKETS"]});
const handleFinish = async (values) => {
logImEXEvent("TimeTicketClockOff_handleFinish");
// console.log("TimeTicketClockOff, values.cost_center?.value :", currentSCC);
if (
!!values.actualhours &&