feature/IO-3497-Ant-Design-v5-to-v6 - Revert any apollo updates
This commit is contained in:
@@ -51,11 +51,10 @@ const CardPaymentModalComponent = ({
|
||||
const { t } = useTranslation();
|
||||
const notification = useNotification();
|
||||
|
||||
const [executeQuery, { data, loading: queryLoading }] = useLazyQuery(QUERY_RO_AND_OWNER_BY_JOB_PKS);
|
||||
|
||||
const refetch = (variables) => {
|
||||
return executeQuery({ variables });
|
||||
};
|
||||
const [, { data, refetch, queryLoading }] = useLazyQuery(QUERY_RO_AND_OWNER_BY_JOB_PKS, {
|
||||
variables: { jobids: [context.jobid] },
|
||||
skip: !context?.jobid
|
||||
});
|
||||
|
||||
const collectIPayFields = () => {
|
||||
const iPayFields = document.querySelectorAll(".ipayfield");
|
||||
|
||||
@@ -66,6 +66,7 @@ export function ScheduleEventComponent({
|
||||
const [form] = Form.useForm();
|
||||
const [popOverVisible, setPopOverVisible] = useState(false);
|
||||
const [getJobDetails] = useLazyQuery(GET_JOB_BY_PK_QUICK_INTAKE, {
|
||||
variables: { id: event.job?.id },
|
||||
onCompleted: (data) => {
|
||||
if (data?.jobs_by_pk) {
|
||||
const totalHours =
|
||||
@@ -408,7 +409,7 @@ export function ScheduleEventComponent({
|
||||
onClick={(e) => {
|
||||
if (event.job?.id) {
|
||||
e.stopPropagation();
|
||||
getJobDetails({ variables: { id: event.job.id } });
|
||||
getJobDetails();
|
||||
}
|
||||
}}
|
||||
getPopupContainer={(trigger) => trigger.parentNode}
|
||||
|
||||
@@ -42,6 +42,7 @@ export function JobsDetailHeaderActionsToggleProduction({
|
||||
const notification = useNotification();
|
||||
|
||||
const [getJobDetails, { loading: jobDetailsLoading }] = useLazyQuery(GET_JOB_BY_PK_QUICK_INTAKE, {
|
||||
variables: { id: job.id },
|
||||
onCompleted: (data) => {
|
||||
if (data?.jobs_by_pk) {
|
||||
const totalHours =
|
||||
@@ -203,7 +204,7 @@ export function JobsDetailHeaderActionsToggleProduction({
|
||||
open={popOverVisible}
|
||||
onOpenChange={setPopOverVisible}
|
||||
onClick={(e) => {
|
||||
getJobDetails({ variables: { id: job.id } });
|
||||
getJobDetails();
|
||||
e.stopPropagation();
|
||||
}}
|
||||
getPopupContainer={(trigger) => trigger.parentNode}
|
||||
|
||||
@@ -22,7 +22,11 @@ export default function OwnerFindModalContainer({
|
||||
const { t } = useTranslation();
|
||||
const [searchText, setSearchText] = useState(null);
|
||||
|
||||
const [callSearchowners, ownersList] = useLazyQuery(QUERY_SEARCH_OWNER_BY_IDX);
|
||||
const [callSearchowners, ownersList] = useLazyQuery(QUERY_SEARCH_OWNER_BY_IDX, {
|
||||
variables: {
|
||||
search: searchText
|
||||
}
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
if (modalProps.open && owner) {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { onError } from "@apollo/client/link/error";
|
||||
//https://stackoverflow.com/questions/57163454/refreshing-a-token-with-apollo-client-firebase-auth
|
||||
|
||||
const errorLink = onError(({ error, operation, forward }) => {
|
||||
if (error?.graphQLErrors) {
|
||||
error.graphQLErrors.forEach(({ message, locations, path }) => {
|
||||
const errorLink = onError(({ graphQLErrors, networkError, operation, forward }) => {
|
||||
if (graphQLErrors) {
|
||||
graphQLErrors.forEach(({ message, locations, path }) => {
|
||||
console.log(`[GraphQL error]: Message: ${message}, Location: ${locations}, Path: ${path}`);
|
||||
});
|
||||
}
|
||||
if (error?.networkError) console.log(`[Network error]: ${JSON.stringify(error.networkError)}`);
|
||||
if (networkError) console.log(`[Network error]: ${JSON.stringify(networkError)}`);
|
||||
console.log(operation.getContext());
|
||||
return forward(operation);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user