启动与授权-初步优化
This commit is contained in:
@@ -1,32 +0,0 @@
|
||||
import { apiDelete, apiGet, apiPost } from "./axios";
|
||||
import type { FeeApiResponse } from "../types/api";
|
||||
|
||||
export const listFeeAttachments = (entityType: string, entityId: string) =>
|
||||
apiGet<FeeApiResponse<any[]>>("/api/v1/fees/attachments", { params: { entity_type: entityType, entity_id: entityId } });
|
||||
|
||||
export const uploadFeeAttachment = (
|
||||
entityType: string,
|
||||
entityId: string,
|
||||
fileType: string,
|
||||
file: File,
|
||||
options?: Record<string, any>
|
||||
) => {
|
||||
const formData = new FormData();
|
||||
formData.append("file", file);
|
||||
formData.append("entity_type", entityType);
|
||||
formData.append("entity_id", entityId);
|
||||
formData.append("file_type", fileType);
|
||||
return apiPost<FeeApiResponse<any>>("/api/v1/fees/attachments", formData, {
|
||||
headers: { "Content-Type": "multipart/form-data" },
|
||||
...options,
|
||||
});
|
||||
};
|
||||
|
||||
export const deleteFeeAttachment = (attachmentId: string) => apiDelete(`/api/v1/fees/attachments/${attachmentId}`);
|
||||
|
||||
export const getFeeAttachmentDownloadUrl = (attachmentId: string) => {
|
||||
const token = localStorage.getItem("ctms_token");
|
||||
return token
|
||||
? `/api/v1/fees/attachments/${attachmentId}/download?token=${token}`
|
||||
: `/api/v1/fees/attachments/${attachmentId}/download`;
|
||||
};
|
||||
@@ -42,9 +42,6 @@ export const createKickoff = (studyId: string, payload: Record<string, any>) =>
|
||||
export const updateKickoff = (studyId: string, id: string, payload: Record<string, any>) =>
|
||||
apiPatch(`/api/v1/studies/${studyId}/startup/kickoff/${id}`, payload);
|
||||
|
||||
export const deleteKickoff = (studyId: string, id: string) =>
|
||||
apiDelete(`/api/v1/studies/${studyId}/startup/kickoff/${id}`);
|
||||
|
||||
export const listTrainingAuthorizations = (studyId: string, params?: Record<string, any>) =>
|
||||
apiGet(`/api/v1/studies/${studyId}/startup/training-authorizations`, { params });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user