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

44
lib/api/creatives.ts Normal file
View File

@@ -0,0 +1,44 @@
// ============================================================================
// Creatives API
// ============================================================================
import { api } from "./client";
import type {
Creative,
CreativeDetail,
CreativeQueryParams,
CreativeCreateRequest,
CreativeUpdateRequest,
ListResponse,
SuccessResponse,
} from "@/lib/types/api";
export const creativesApi = {
/**
* Get list of creatives
*/
list: (params?: CreativeQueryParams) =>
api.get<ListResponse<Creative>>("/creatives", { params }),
/**
* Get creative details
*/
get: (id: string) => api.get<CreativeDetail>(`/creatives/${id}`),
/**
* Create new creative
*/
create: (data: CreativeCreateRequest) =>
api.post<Creative>("/creatives", data),
/**
* Update creative
*/
update: (id: string, data: CreativeUpdateRequest) =>
api.patch<Creative>(`/creatives/${id}`, data),
/**
* Delete creative
*/
delete: (id: string) => api.delete<SuccessResponse>(`/creatives/${id}`),
};