feat: global ui & functional update
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
import { api } from "./client";
|
||||
import type {
|
||||
Placement,
|
||||
PlacementWithStats,
|
||||
PlacementCreateRequest,
|
||||
PlacementUpdateRequest,
|
||||
PlacementsQueryParams,
|
||||
@@ -23,6 +24,13 @@ export const placementsApi = {
|
||||
{ params }
|
||||
),
|
||||
|
||||
/**
|
||||
* Get placements for a specific project (grouped by channel UI)
|
||||
*/
|
||||
getByProject: (workspaceId: string, projectId: string) =>
|
||||
api.get<{ placements: Placement[] }>(`/workspaces/${workspaceId}/projects/${projectId}/placements`)
|
||||
.then((response) => response.placements),
|
||||
|
||||
/**
|
||||
* Get single placement
|
||||
*/
|
||||
@@ -35,6 +43,46 @@ export const placementsApi = {
|
||||
create: (workspaceId: string, data: PlacementCreateRequest) =>
|
||||
api.post<Placement>(`/workspaces/${workspaceId}/placements`, data),
|
||||
|
||||
/**
|
||||
* Create placements for multiple channels (bulk creation)
|
||||
*/
|
||||
createBulk: (
|
||||
workspaceId: string,
|
||||
projectId: string,
|
||||
data: {
|
||||
creative_id?: string;
|
||||
channels: Array<{
|
||||
username: string;
|
||||
status?: string;
|
||||
comment?: string;
|
||||
details?: {
|
||||
placement_at?: string;
|
||||
payment_at?: string;
|
||||
cost?: { type: string; value: number };
|
||||
cost_before_bargain?: number;
|
||||
placement_type?: string;
|
||||
format?: string;
|
||||
comment?: string;
|
||||
creative_id?: string;
|
||||
};
|
||||
}>;
|
||||
details?: {
|
||||
placement_at?: string;
|
||||
payment_at?: string;
|
||||
cost?: { type: string; value: number };
|
||||
cost_before_bargain?: number;
|
||||
placement_type?: string;
|
||||
format?: string;
|
||||
comment?: string;
|
||||
creative_id?: string;
|
||||
};
|
||||
}
|
||||
) =>
|
||||
api.post<{ placements: Placement[] }>(
|
||||
`/workspaces/${workspaceId}/projects/${projectId}/placements`,
|
||||
data
|
||||
),
|
||||
|
||||
/**
|
||||
* Update placement
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user