improvement for the backend api

This commit is contained in:
ivannoskov
2025-11-19 12:56:04 +03:00
parent b0a9934220
commit d4672ea32b
40 changed files with 2383 additions and 3313 deletions

View File

@@ -59,12 +59,12 @@ export default function AnalyticsCostsPage() {
const [reportData, channelsData] = await Promise.all([
analyticsApi.costs({ period, target_channel_id: targetChannelId }),
channels.length > 0
? Promise.resolve({ data: channels })
: channelsApi.list({}),
? Promise.resolve({ target_channels: channels })
: channelsApi.list(),
]);
setReport(reportData);
if (channels.length === 0) {
setChannels(channelsData.data);
setChannels(channelsData.target_channels);
}
} catch (err: any) {
setError(err?.error?.message || "Ошибка загрузки аналитики");