| 1 |
import { analyticsApi } from '../api/analyticsApi'; |
| 2 |
|
| 3 |
export const summaryApi = analyticsApi.injectEndpoints({ |
| 4 |
endpoints: (builder) => ({ |
| 5 |
// GET /analytics/summary |
| 6 |
getSummary: builder.query({ |
| 7 |
query: ({ date_from, date_to } = {}) => ({ |
| 8 |
url: '/summary', |
| 9 |
params: { date_from, date_to }, |
| 10 |
}), |
| 11 |
}), |
| 12 |
|
| 13 |
// GET /analytics/revenue-chart |
| 14 |
getRevenueChart: builder.query({ |
| 15 |
query: ({ date_from, date_to } = {}) => ({ |
| 16 |
url: '/revenue-chart', |
| 17 |
params: { date_from, date_to }, |
| 18 |
}), |
| 19 |
}), |
| 20 |
|
| 21 |
// GET /analytics/intents-performance |
| 22 |
getIntentsPerformance: builder.query({ |
| 23 |
query: ({ date_from, date_to } = {}) => ({ |
| 24 |
url: '/intents-performance', |
| 25 |
params: { date_from, date_to }, |
| 26 |
}), |
| 27 |
}), |
| 28 |
}), |
| 29 |
}); |
| 30 |
|
| 31 |
export const { |
| 32 |
useGetSummaryQuery, |
| 33 |
useGetRevenueChartQuery, |
| 34 |
useGetIntentsPerformanceQuery, |
| 35 |
} = summaryApi; |
| 36 |
|