mirror of
				https://github.com/strapi/strapi.git
				synced 2025-11-03 19:36:20 +00:00 
			
		
		
		
	Use isError key instead of status
This commit is contained in:
		
							parent
							
								
									5a5a2666b1
								
							
						
					
					
						commit
						f3d41e3eac
					
				@ -31,15 +31,15 @@ const useAuditLogsData = ({ canRead }) => {
 | 
			
		||||
  const {
 | 
			
		||||
    data: auditLogs,
 | 
			
		||||
    isLoading,
 | 
			
		||||
    status: auditLogsStatus,
 | 
			
		||||
    isError: isAuditLogsError,
 | 
			
		||||
  } = useQuery(['auditLogs', search], fetchAuditLogsPage, queryOptions);
 | 
			
		||||
 | 
			
		||||
  const { data: users, status: userStatus } = useQuery(['auditLogsUsers'], fetchAllUsers, {
 | 
			
		||||
  const { data: users, isError: isUsersError } = useQuery(['auditLogsUsers'], fetchAllUsers, {
 | 
			
		||||
    ...queryOptions,
 | 
			
		||||
    staleTime: 2 * (1000 * 60), // 2 minutes
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  const hasError = [userStatus, auditLogsStatus].includes('error');
 | 
			
		||||
  const hasError = isAuditLogsError || isUsersError;
 | 
			
		||||
 | 
			
		||||
  return { auditLogs, users: users?.data, isLoading, hasError };
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user