mirror of
				https://github.com/Telecominfraproject/wlan-cloud-ui.git
				synced 2025-10-31 02:37:54 +00:00 
			
		
		
		
	fixed Alarms error handling
This commit is contained in:
		| @@ -31,6 +31,7 @@ const Alarms = () => { | |||||||
|   const { customerId } = useContext(UserContext); |   const { customerId } = useContext(UserContext); | ||||||
|   const { loading, error, data, refetch, fetchMore } = useQuery(GET_ALL_ALARMS, { |   const { loading, error, data, refetch, fetchMore } = useQuery(GET_ALL_ALARMS, { | ||||||
|     variables: { customerId }, |     variables: { customerId }, | ||||||
|  |     errorPolicy: 'all', | ||||||
|   }); |   }); | ||||||
|  |  | ||||||
|   const handleOnReload = () => { |   const handleOnReload = () => { | ||||||
| @@ -73,9 +74,10 @@ const Alarms = () => { | |||||||
|     return <Loading />; |     return <Loading />; | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   if (error) { |   if (error && !data?.getAllAlarms?.items) { | ||||||
|     return <Alert message="Error" description="Failed to load alarms." type="error" showIcon />; |     return <Alert message="Error" description="Failed to load alarms." type="error" showIcon />; | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   return ( |   return ( | ||||||
|     <AlarmsPage |     <AlarmsPage | ||||||
|       data={data.getAllAlarms.items} |       data={data.getAllAlarms.items} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Sean Macfarlane
					Sean Macfarlane