undo commit

This commit is contained in:
irtiza-h30
2021-08-20 17:22:26 -04:00
parent 30bf5adfc1
commit 0de1e380b5

View File

@@ -1,7 +1,7 @@
import React, { useState, useContext } from 'react';
import { useParams, Redirect } from 'react-router-dom';
import { useQuery, useMutation, gql } from '@apollo/client';
import { notification } from 'antd';
import { Alert, notification } from 'antd';
import { ProfileDetails as ProfileDetailsPage, Loading } from '@tip-wlan/wlan-cloud-ui-library';
import { ROUTES, AUTH_TOKEN } from 'constants/index';
@@ -89,10 +89,9 @@ const ProfileDetails = () => {
const { data: apiUrl } = useQuery(GET_API_URL);
const { loading, data } = useQuery(GET_PROFILE, {
const { loading, error, data } = useQuery(GET_PROFILE, {
variables: { id },
fetchPolicy: 'network-only',
errorPolicy: 'all',
});
const { data: ssidProfiles, fetchMore } = useQuery(GET_ALL_PROFILES(), {
@@ -286,10 +285,15 @@ const ProfileDetails = () => {
};
if (loading) {
s;
return <Loading />;
}
if (error) {
return (
<Alert message="Error" description="Failed to load profile data." type="error" showIcon />
);
}
if (redirect) {
return <Redirect to={ROUTES.profiles} />;
}