fix: resolve all flake8 errors and apply Prettier formatting (#131)
Deploy / Deploy Staging (push) Failing after 210h26m26s
CI/CD Pipeline / Frontend Lint (push) Failing after 210h27m0s
CI/CD Pipeline / Validate Code Quality And Tests (push) Failing after 210h27m7s
Deploy / Production Browser E2E (push) Failing after 1869h1m52s
Deploy / Build Production Runtime Images (push) Failing after 1869h1m56s
Deploy / Deploy Production (push) Failing after 1869h33m15s
Deploy / Deploy Staging (push) Failing after 210h26m26s
CI/CD Pipeline / Frontend Lint (push) Failing after 210h27m0s
CI/CD Pipeline / Validate Code Quality And Tests (push) Failing after 210h27m7s
Deploy / Production Browser E2E (push) Failing after 1869h1m52s
Deploy / Build Production Runtime Images (push) Failing after 1869h1m56s
Deploy / Deploy Production (push) Failing after 1869h33m15s
This commit was merged in pull request #131.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
* 项目相关 API
|
||||
* 素材库需要 project_id,前端自动管理默认项目
|
||||
*/
|
||||
import apiClient from './client';
|
||||
import apiClient from "./client";
|
||||
|
||||
export interface ProjectItem {
|
||||
id: string;
|
||||
@@ -30,7 +30,8 @@ const toProjectItem = (item: BackendProjectResponse): ProjectItem => ({
|
||||
|
||||
/** 获取当前用户的项目列表 */
|
||||
export const getProjects = async (): Promise<ProjectItem[]> => {
|
||||
const response = await apiClient.get<BackendListProjectsResponse>('/projects');
|
||||
const response =
|
||||
await apiClient.get<BackendListProjectsResponse>("/projects");
|
||||
return (response.data.items || []).map(toProjectItem);
|
||||
};
|
||||
|
||||
@@ -39,9 +40,9 @@ export const createProject = async (data: {
|
||||
name: string;
|
||||
description?: string;
|
||||
}): Promise<ProjectItem> => {
|
||||
const response = await apiClient.post<BackendProjectResponse>('/projects', {
|
||||
const response = await apiClient.post<BackendProjectResponse>("/projects", {
|
||||
name: data.name,
|
||||
description: data.description || '',
|
||||
description: data.description || "",
|
||||
});
|
||||
return toProjectItem(response.data);
|
||||
};
|
||||
@@ -54,7 +55,7 @@ export const getOrCreateDefaultProject = async (): Promise<ProjectItem> => {
|
||||
}
|
||||
// 没有项目时自动创建默认项目
|
||||
return createProject({
|
||||
name: '默认项目',
|
||||
description: '系统自动创建的默认项目',
|
||||
name: "默认项目",
|
||||
description: "系统自动创建的默认项目",
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user