Files
opc-web/src/api/certifications.ts

41 lines
1.3 KiB
TypeScript
Raw Normal View History

import api from './index';
// OPC认证接口
/**
* @author xujl
* Api说明: getCertifications
*/
export const getCertifications = (params?: any) => api.get('/certifications/', { params });
/**
* @author xujl
* Api说明: getCertificationDetail
*/
export const getCertificationDetail = (id: string) => api.get(`/certifications/${id}/`);
/**
* @author xujl
* Api说明: submitCertification
*/
export const submitCertification = (data: { real_name: string; id_card?: string; skills?: string[]; experience?: string; resume_url?: string; attachments?: any[] }) => api.post('/certifications/', data);
/**
* @author xujl
* Api说明: updateCertification
*/
export const updateCertification = (id: string, data: any) => api.put(`/certifications/${id}/`, data);
/**
* @author xujl
* Api说明: deleteCertification
*/
export const deleteCertification = (id: string) => api.delete(`/certifications/${id}/`);
// 管理员审核操作
/**
* @author xujl
* Api说明: approveCertification
*/
export const approveCertification = (id: string) => api.post(`/certifications/${id}/approve/`);
/**
* @author xujl
* Api说明: rejectCertification
*/
export const rejectCertification = (id: string, reject_reason: string) => api.post(`/certifications/${id}/reject/`, { reject_reason });