feat: global platform v2 update

This commit is contained in:
ivannoskov
2025-12-29 10:12:13 +03:00
parent 8e6a1fa83f
commit f64cf02100
84 changed files with 11023 additions and 11486 deletions

View File

@@ -1,24 +1,18 @@
// ============================================================================
// Target Channels API
// Channels API (Catalog for Placements)
// ============================================================================
import { api } from "./client";
import type {
TargetChannel,
TargetChannelsListResponse,
SuccessResponse,
Channel,
ChannelsQueryParams,
PaginatedResponse,
} from "@/lib/types/api";
export const channelsApi = {
/**
* Get list of target channels
* GET /api/v1/target_channels
* Get catalog of channels for placements
*/
list: () => api.get<TargetChannelsListResponse>("/target_channels"),
/**
* Delete (disconnect) target channel
* DELETE /api/v1/target_channels/{channel_id}
*/
delete: (id: string) => api.delete<SuccessResponse>(`/target_channels/${id}`),
list: (params?: ChannelsQueryParams) =>
api.get<PaginatedResponse<Channel>>("/channels", { params }),
};