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

Function removeApplicant

src/Data/ApplicantData.js:141–160  ·  view source on GitHub ↗
(applicantId)

Source from the content-addressed store, hash-verified

139}
140
141export async function removeApplicant(applicantId) {
142 /*
143 * Remove the applicant from the local storage and the server.
144 * @param applicantId [String]: applicantId
145 */
146 await apiRequest(REMOVE_APPLICANT, {
147 body: {
148 ApplicantID: applicantId,
149 },
150 });
151
152 const records = await getRecordByApplicant(applicantId);
153 const applicants = await getApplicants();
154 await setApplicants(applicants.filter(p => p.ApplicantID !== applicantId));
155 await deleteApplicantIDByDisplayName(applicantId);
156 // The backend currently blocks deletion with records, but clear stale local records defensively.
157 for (const recordId of Object.keys(records)) {
158 await deleteRecord(recordId);
159 }
160}
161
162
163export async function isAuthApplicant(applicantId) {

Callers 1

actionFunction · 0.90

Calls 6

apiRequestFunction · 0.90
getRecordByApplicantFunction · 0.90
deleteRecordFunction · 0.90
getApplicantsFunction · 0.85
setApplicantsFunction · 0.85

Tested by

no test coverage detected