Spaces:
Running
Running
Download frontend/src/api/projects.ts from Falln87/OmniVoice-Studio: direct link, hf CLI and curl.
- Browser
- Download file 738 Bytes
-
https://huggingface.co/spaces/Falln87/OmniVoice-Studio/resolve/main/frontend/src/api/projects.ts
- Command line
-
hf download hf://spaces/Falln87/OmniVoice-Studio/frontend/src/api/projects.ts
-
curl -L -o projects.ts https://huggingface.co/spaces/Falln87/OmniVoice-Studio/resolve/main/frontend/src/api/projects.ts
738 Bytes
| import { apiJson, apiPost, apiFetch } from './client'; | |
| import type { ProjectSummary, ProjectDetail } from './types'; | |
| export async function listProjects(): Promise<ProjectSummary[]> { | |
| return apiJson<ProjectSummary[]>('/projects'); | |
| } | |
| export async function saveProject(body: Record<string, unknown>, id?: string): Promise<ProjectDetail> { | |
| if (id) return apiPost<ProjectDetail>(`/projects/${id}`, body, { method: 'PUT' }); | |
| return apiPost<ProjectDetail>('/projects', body); | |
| } | |
| export async function loadProject(id: string): Promise<ProjectDetail> { | |
| return apiJson<ProjectDetail>(`/projects/${id}`); | |
| } | |
| export async function deleteProject(id: string): Promise<Response> { | |
| return apiFetch(`/projects/${id}`, { method: 'DELETE' }); | |
| } | |