Step F5:受试者 & 访视管理
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
import { apiGet } from "./axios";
|
||||
import type { ApiListResponse } from "../types/api";
|
||||
|
||||
export const fetchSites = (studyId: string) =>
|
||||
apiGet<ApiListResponse<any>>(`/api/v1/studies/${studyId}/sites/`);
|
||||
@@ -0,0 +1,11 @@
|
||||
import { apiGet, apiPost, apiPatch } from "./axios";
|
||||
import type { ApiListResponse } from "../types/api";
|
||||
|
||||
export const fetchSubjects = (studyId: string, params?: Record<string, any>) =>
|
||||
apiGet<ApiListResponse<any>>(`/api/v1/studies/${studyId}/subjects/`, { params });
|
||||
|
||||
export const createSubject = (studyId: string, payload: Record<string, any>) =>
|
||||
apiPost(`/api/v1/studies/${studyId}/subjects/`, payload);
|
||||
|
||||
export const updateSubject = (studyId: string, subjectId: string, payload: Record<string, any>) =>
|
||||
apiPatch(`/api/v1/studies/${studyId}/subjects/${subjectId}`, payload);
|
||||
@@ -0,0 +1,7 @@
|
||||
import { apiGet, apiPatch } from "./axios";
|
||||
|
||||
export const fetchVisits = (studyId: string, subjectId: string) =>
|
||||
apiGet(`/api/v1/studies/${studyId}/subjects/${subjectId}/visits/`);
|
||||
|
||||
export const updateVisit = (studyId: string, subjectId: string, visitId: string, payload: Record<string, any>) =>
|
||||
apiPatch(`/api/v1/studies/${studyId}/subjects/${subjectId}/visits/${visitId}`, payload);
|
||||
Reference in New Issue
Block a user