MCPcopy Index your code
hub / github.com/OpenSIST/OpenSIST.github.io / getApplicant

Function getApplicant

src/Data/ApplicantData.js:59–73  ·  view source on GitHub ↗
(applicantId, isRefresh = false, options = {})

Source from the content-addressed store, hash-verified

57}
58
59export 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
75export async function setApplicants(applicants) {
76 /*

Callers 7

loadApplicantProfileFunction · 0.90
loaderFunction · 0.90
addModifyFileFunction · 0.90
removeFileFunction · 0.90
addModifyRecordFunction · 0.90
getRecordByApplicantFunction · 0.90
deleteRecordFunction · 0.90

Calls 2

getMetadataFunction · 0.90
getApplicantsFunction · 0.85

Tested by

no test coverage detected