Route analytics access through composable
This commit is contained in:
@@ -11,3 +11,4 @@ export { useRouteLoading } from './useRouteLoading'
|
||||
export { useSendFlow } from './useSendFlow'
|
||||
export { useSystemConfig } from './useSystemConfig'
|
||||
export { useTheme } from './useTheme'
|
||||
export { useTransferAnalytics } from './useTransferAnalytics'
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
import { StatsService } from '@/services'
|
||||
import type { AnalyticsData } from '@/types'
|
||||
|
||||
export function useTransferAnalytics() {
|
||||
const fetchAnalytics = async (start?: string, end?: string): Promise<AnalyticsData | null> => {
|
||||
const response = await StatsService.getAnalytics(start, end)
|
||||
return response.detail || null
|
||||
}
|
||||
|
||||
return {
|
||||
fetchAnalytics
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user