- "backend/routers/creators.py" - "backend/schemas.py" - "frontend/src/api/templates.ts" - "frontend/src/pages/HighlightQueue.tsx" - "frontend/src/pages/HighlightQueue.module.css" - "backend/routers/shorts.py" - "backend/pipeline/stages.py" - "frontend/src/api/shorts.ts" GSD-Task: S04/T03
39 lines
1.3 KiB
TypeScript
39 lines
1.3 KiB
TypeScript
import { request, BASE } from "./client";
|
|
|
|
// ── Types ────────────────────────────────────────────────────────────────────
|
|
|
|
export interface ShortsTemplateConfig {
|
|
show_intro: boolean;
|
|
intro_text: string;
|
|
intro_duration_secs: number;
|
|
show_outro: boolean;
|
|
outro_text: string;
|
|
outro_duration_secs: number;
|
|
accent_color: string;
|
|
font_family: string;
|
|
}
|
|
|
|
export type ShortsTemplateUpdate = ShortsTemplateConfig;
|
|
|
|
// ── API functions ────────────────────────────────────────────────────────────
|
|
|
|
export function fetchShortsTemplate(
|
|
creatorId: string,
|
|
): Promise<ShortsTemplateConfig> {
|
|
return request<ShortsTemplateConfig>(
|
|
`${BASE}/admin/creators/${encodeURIComponent(creatorId)}/shorts-template`,
|
|
);
|
|
}
|
|
|
|
export function updateShortsTemplate(
|
|
creatorId: string,
|
|
config: ShortsTemplateUpdate,
|
|
): Promise<ShortsTemplateConfig> {
|
|
return request<ShortsTemplateConfig>(
|
|
`${BASE}/admin/creators/${encodeURIComponent(creatorId)}/shorts-template`,
|
|
{
|
|
method: "PUT",
|
|
body: JSON.stringify(config),
|
|
},
|
|
);
|
|
}
|