feat: P4 ChannelAnalytics tab; P5 FromUrlModal + URL→draft in ChannelView

This commit is contained in:
Nik (Claude)
2026-06-08 11:09:03 +03:00
parent b8a570f04a
commit eac6e2ed13
7 changed files with 555 additions and 0 deletions
+16
View File
@@ -74,6 +74,22 @@ export const engine = {
const qs = new URLSearchParams(params).toString();
return call(`/api/calendar${qs ? '?' + qs : ''}`, { userId });
},
// Metrics
getChannelMetrics: (channelId, params = {}) => {
const qs = new URLSearchParams(params).toString();
return call(`/api/metrics/channel/${channelId}${qs ? '?' + qs : ''}`);
},
getBestTime: (channelId, params = {}) => {
const qs = new URLSearchParams(params).toString();
return call(`/api/metrics/best-time/${channelId}${qs ? '?' + qs : ''}`);
},
getUserPostMetrics: (userId, channelId, params = {}) => {
const qs = new URLSearchParams(params).toString();
return call(`/api/metrics/user-posts/${channelId}${qs ? '?' + qs : ''}`, { userId });
},
collectMetrics: () => call('/api/metrics/collect', { method: 'POST' }),
generateFromUrl: (userId, data) => call('/api/generate/from-url', { userId, method: 'POST', body: data }),
updateUserPostSchedule: (userId, id, scheduledAt) =>
call(`/api/user-posts/${id}`, { userId, method: 'PATCH', body: { scheduled_at: scheduledAt } }),
};