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