(applicantId, isRefresh = false, options = {})
| 57 | } |
| 58 | |
| 59 | export async function getApplicant(applicantId, isRefresh = false, options = {}) { |
| 60 | /* |
| 61 | * Get the applicant from the server or local storage by applicantId |
| 62 | * @param applicantId [String]: applicantId |
| 63 | * @param isRefresh [Boolean]: whether to refresh the data |
| 64 | * @return: applicant |
| 65 | */ |
| 66 | const applicants = await getApplicants(isRefresh, options); |
| 67 | const applicant = applicants.find(p => p.ApplicantID === applicantId); |
| 68 | if (!applicant) { |
| 69 | await getMetadata(applicantId.split('@')[0], true); |
| 70 | throw new Error('Applicant not found'); |
| 71 | } |
| 72 | return applicant; |
| 73 | } |
| 74 | |
| 75 | export async function setApplicants(applicants) { |
| 76 | /* |
no test coverage detected