From 0de1e380b5090250f24f3b903b41ebf89c5b7687 Mon Sep 17 00:00:00 2001 From: irtiza-h30 Date: Fri, 20 Aug 2021 17:22:26 -0400 Subject: [PATCH] undo commit --- app/containers/ProfileDetails/index.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/containers/ProfileDetails/index.js b/app/containers/ProfileDetails/index.js index a3d5813..aa8ba6b 100644 --- a/app/containers/ProfileDetails/index.js +++ b/app/containers/ProfileDetails/index.js @@ -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 ; } + if (error) { + return ( + + ); + } + if (redirect) { return ; }