mirror of
https://github.com/strapi/strapi.git
synced 2025-11-11 15:49:50 +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 {
|
const {
|
||||||
data: auditLogs,
|
data: auditLogs,
|
||||||
isLoading,
|
isLoading,
|
||||||
status: auditLogsStatus,
|
isError: isAuditLogsError,
|
||||||
} = useQuery(['auditLogs', search], fetchAuditLogsPage, queryOptions);
|
} = useQuery(['auditLogs', search], fetchAuditLogsPage, queryOptions);
|
||||||
|
|
||||||
const { data: users, status: userStatus } = useQuery(['auditLogsUsers'], fetchAllUsers, {
|
const { data: users, isError: isUsersError } = useQuery(['auditLogsUsers'], fetchAllUsers, {
|
||||||
...queryOptions,
|
...queryOptions,
|
||||||
staleTime: 2 * (1000 * 60), // 2 minutes
|
staleTime: 2 * (1000 * 60), // 2 minutes
|
||||||
});
|
});
|
||||||
|
|
||||||
const hasError = [userStatus, auditLogsStatus].includes('error');
|
const hasError = isAuditLogsError || isUsersError;
|
||||||
|
|
||||||
return { auditLogs, users: users?.data, isLoading, hasError };
|
return { auditLogs, users: users?.data, isLoading, hasError };
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user