New reports screens.
This commit is contained in:
@@ -10,6 +10,7 @@ export * from './useLocale';
|
||||
export * from './useMessages';
|
||||
export * from './usePageQuery';
|
||||
export * from './useReport';
|
||||
export * from './useReports';
|
||||
export * from './useRequireLogin';
|
||||
export * from './useShareToken';
|
||||
export * from './useSticky';
|
||||
|
||||
10
hooks/useReports.js
Normal file
10
hooks/useReports.js
Normal file
@@ -0,0 +1,10 @@
|
||||
import useApi from './useApi';
|
||||
|
||||
export function useReports() {
|
||||
const { get, useQuery } = useApi();
|
||||
const { data, error, isLoading } = useQuery(['reports'], () => get(`/reports`));
|
||||
|
||||
return { reports: data, error, isLoading };
|
||||
}
|
||||
|
||||
export default useReports;
|
||||
Reference in New Issue
Block a user