mirror of
https://github.com/Telecominfraproject/wlan-cloud-ui.git
synced 2025-11-01 19:27:51 +00:00
updated gql errorPolicy
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import React, { useState, useContext } from 'react';
|
import React, { useState, useContext } from 'react';
|
||||||
import { useParams, Redirect } from 'react-router-dom';
|
import { useParams, Redirect } from 'react-router-dom';
|
||||||
import { useQuery, useMutation, gql } from '@apollo/client';
|
import { useQuery, useMutation, gql } from '@apollo/client';
|
||||||
import { Alert, notification } from 'antd';
|
import { notification } from 'antd';
|
||||||
import { ProfileDetails as ProfileDetailsPage, Loading } from '@tip-wlan/wlan-cloud-ui-library';
|
import { ProfileDetails as ProfileDetailsPage, Loading } from '@tip-wlan/wlan-cloud-ui-library';
|
||||||
|
|
||||||
import { ROUTES, AUTH_TOKEN } from 'constants/index';
|
import { ROUTES, AUTH_TOKEN } from 'constants/index';
|
||||||
@@ -89,9 +89,10 @@ const ProfileDetails = () => {
|
|||||||
|
|
||||||
const { data: apiUrl } = useQuery(GET_API_URL);
|
const { data: apiUrl } = useQuery(GET_API_URL);
|
||||||
|
|
||||||
const { loading, error, data } = useQuery(GET_PROFILE, {
|
const { loading, data } = useQuery(GET_PROFILE, {
|
||||||
variables: { id },
|
variables: { id },
|
||||||
fetchPolicy: 'network-only',
|
fetchPolicy: 'network-only',
|
||||||
|
errorPolicy: 'all',
|
||||||
});
|
});
|
||||||
|
|
||||||
const { data: ssidProfiles, fetchMore } = useQuery(GET_ALL_PROFILES(), {
|
const { data: ssidProfiles, fetchMore } = useQuery(GET_ALL_PROFILES(), {
|
||||||
@@ -285,15 +286,10 @@ const ProfileDetails = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (loading) {
|
if (loading) {
|
||||||
|
s;
|
||||||
return <Loading />;
|
return <Loading />;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (error) {
|
|
||||||
return (
|
|
||||||
<Alert message="Error" description="Failed to load profile data." type="error" showIcon />
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (redirect) {
|
if (redirect) {
|
||||||
return <Redirect to={ROUTES.profiles} />;
|
return <Redirect to={ROUTES.profiles} />;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user