Files
xiaoxia-saas/apps/web/src/api/projects.ts
T
Xiaoxia AI 59291b0e8f
CI/CD Pipeline / Validate Code Quality And Tests (push) Has been cancelled
Deploy / Deploy Staging (push) Has been cancelled
Deploy / Deploy Production (push) Has been cancelled
fix(web): connect project context in media flow
2026-06-21 21:48:21 +08:00

25 lines
645 B
TypeScript

import apiClient from './client';
export interface ProjectItem {
id: string;
workspace_id: string;
name: string;
description: string;
}
export interface CreateProjectRequest {
workspace_id: string;
name: string;
description?: string;
}
export const getProjects = async (workspaceId: string): Promise<ProjectItem[]> => {
const response = await apiClient.get('/projects', { params: { workspace_id: workspaceId } });
return response.data.items;
};
export const createProject = async (data: CreateProjectRequest): Promise<ProjectItem> => {
const response = await apiClient.post('/projects', data);
return response.data;
};