chrysopedia/frontend/src/api/templates.ts
jlightner a60f4074dc chore: Add GET/PUT shorts-template admin endpoints, collapsible templat…
- "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
2026-04-04 11:25:29 +00:00

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),
},
);
}