fix(admin): refresh analytics dashboard layout
This commit is contained in:
@@ -432,6 +432,44 @@ class ApiClient {
|
||||
);
|
||||
}
|
||||
|
||||
async getAdminUserAnalytics(params?: { date_from?: string; date_to?: string }) {
|
||||
const query = new URLSearchParams();
|
||||
if (params?.date_from) query.set('date_from', params.date_from);
|
||||
if (params?.date_to) query.set('date_to', params.date_to);
|
||||
return this.request<Types.UserAnalyticsSchema>(
|
||||
`/api/analytics/admin/users${query.toString() ? `?${query.toString()}` : ''}`,
|
||||
);
|
||||
}
|
||||
|
||||
async getAdminEventAnalytics(params?: { date_from?: string; date_to?: string; event_id?: number }) {
|
||||
const query = new URLSearchParams();
|
||||
if (params?.date_from) query.set('date_from', params.date_from);
|
||||
if (params?.date_to) query.set('date_to', params.date_to);
|
||||
if (params?.event_id != null) query.set('event_id', String(params.event_id));
|
||||
return this.request<Types.EventAnalyticsSchema>(
|
||||
`/api/analytics/admin/events${query.toString() ? `?${query.toString()}` : ''}`,
|
||||
);
|
||||
}
|
||||
|
||||
async getAdminBlogAnalytics(params?: { date_from?: string; date_to?: string }) {
|
||||
const query = new URLSearchParams();
|
||||
if (params?.date_from) query.set('date_from', params.date_from);
|
||||
if (params?.date_to) query.set('date_to', params.date_to);
|
||||
return this.request<Types.BlogAnalyticsSchema>(
|
||||
`/api/analytics/admin/blog${query.toString() ? `?${query.toString()}` : ''}`,
|
||||
);
|
||||
}
|
||||
|
||||
async getAdminDashboardEventOptions(params?: { search?: string; limit?: number; offset?: number }) {
|
||||
const query = new URLSearchParams();
|
||||
if (params?.search) query.set('search', params.search);
|
||||
if (params?.limit != null) query.set('limit', String(params.limit));
|
||||
if (params?.offset != null) query.set('offset', String(params.offset));
|
||||
return this.request<Types.AnalyticsEventOptionsSchema>(
|
||||
`/api/analytics/admin/events/options${query.toString() ? `?${query.toString()}` : ''}`,
|
||||
);
|
||||
}
|
||||
|
||||
// ============= Blog Endpoints =============
|
||||
|
||||
async getPosts(params?: {
|
||||
|
||||
Reference in New Issue
Block a user