feat: placements update

This commit is contained in:
ivannoskov
2026-01-26 12:13:38 +03:00
parent 63b2fd5d77
commit f46a3265c6
6 changed files with 499 additions and 43 deletions

View File

@@ -9,10 +9,32 @@ import type {
PaginatedResponse,
} from "@/lib/types/api";
interface CreateChannelInput {
username?: string;
invite_link?: string;
}
interface CreateChannelResult {
channel: {
id: string;
};
}
interface CreateChannelsResponse {
results: CreateChannelResult[];
}
export const channelsApi = {
/**
* Get catalog of channels for placements
*/
list: (params?: ChannelsQueryParams) =>
api.get<PaginatedResponse<Channel>>("/channels", { params }),
/**
* Create channels by username or invite_link
* Returns channel IDs for use in placement creation
*/
create: (channels: CreateChannelInput[]) =>
api.post<CreateChannelsResponse>("/channels", { channels }),
};