feat: all project setup

This commit is contained in:
ivannoskov
2025-11-10 12:07:24 +03:00
parent fbfd7719bb
commit b0a9934220
99 changed files with 19597 additions and 0 deletions

37
lib/api/channels.ts Normal file
View File

@@ -0,0 +1,37 @@
// ============================================================================
// Target Channels API
// ============================================================================
import { api } from "./client";
import type {
TargetChannel,
TargetChannelDetail,
TargetChannelQueryParams,
TargetChannelUpdateRequest,
ListResponse,
SuccessResponse,
} from "@/lib/types/api";
export const channelsApi = {
/**
* Get list of target channels
*/
list: (params?: TargetChannelQueryParams) =>
api.get<ListResponse<TargetChannel>>("/target-channels", { params }),
/**
* Get target channel details
*/
get: (id: string) => api.get<TargetChannelDetail>(`/target-channels/${id}`),
/**
* Update target channel (is_active)
*/
update: (id: string, data: TargetChannelUpdateRequest) =>
api.patch<TargetChannel>(`/target-channels/${id}`, data),
/**
* Delete (disconnect) target channel
*/
delete: (id: string) => api.delete<SuccessResponse>(`/target-channels/${id}`),
};