2026-05-04-03-50-07 完善项目库可视化和项目管理
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { OverviewSummary, Project, SessionState, UserRecord } from '../types';
|
||||
import { DicomPreview, OverviewSummary, Project, SessionState, UserRecord } from '../types';
|
||||
|
||||
async function request<T>(path: string, options: RequestInit = {}): Promise<T> {
|
||||
const response = await fetch(path, {
|
||||
@@ -36,6 +36,18 @@ export const api = {
|
||||
getOverview: () => request<OverviewSummary>('/api/overview'),
|
||||
getProjects: () => request<Project[]>('/api/projects'),
|
||||
getProject: (projectId: string) => request<Project>(`/api/projects/${projectId}`),
|
||||
createProject: (name: string) =>
|
||||
request<Project>('/api/projects', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ name }),
|
||||
}),
|
||||
renameProject: (projectId: string, name: string) =>
|
||||
request<Project>(`/api/projects/${projectId}`, {
|
||||
method: 'PATCH',
|
||||
body: JSON.stringify({ name }),
|
||||
}),
|
||||
getDicomPreview: (projectId: string, slice: number) =>
|
||||
request<DicomPreview>(`/api/projects/${projectId}/dicom-preview?slice=${slice}`),
|
||||
getUsers: () => request<UserRecord[]>('/api/users'),
|
||||
resetDemo: () =>
|
||||
request<{ ok: boolean; projects: Project[]; users: UserRecord[] }>('/api/demo/reset', {
|
||||
|
||||
Reference in New Issue
Block a user