MCPcopy Create free account
hub / github.com/OpenSIST/OpenSIST.github.io / loader

Function loader

src/Components/Modify/Record/AddModifyRecord.jsx:19–30  ·  view source on GitHub ↗
({params})

Source from the content-addressed store, hash-verified

17import {decodePathParam, profileApplicantPath, safeLocalPath} from "../../RouteUtils";
18
19export async function loader({params}) {
20 const programs = await getPrograms();
21 const paramsApplicantId = decodePathParam(params?.applicantId);
22 if (!paramsApplicantId) {
23 const displayName = await getDisplayName();
24 const metadata = await getMetadata(displayName);
25 return {programs, applicantIds: metadata?.ApplicantIDs ?? []};
26 }
27 const programId = decodePathParam(params.programId);
28 const recordsDict = programId ? await getRecordByRecordIDs([`${paramsApplicantId}|${programId}`]) : null;
29 return {programs, recordsDict, applicantIds: [paramsApplicantId]};
30}
31
32function createRecordRequestBody(formData) {
33 const applicantId = formData.get('ApplicantID');

Callers

nothing calls this directly

Calls 5

getProgramsFunction · 0.90
decodePathParamFunction · 0.90
getDisplayNameFunction · 0.90
getMetadataFunction · 0.90
getRecordByRecordIDsFunction · 0.90

Tested by

no test coverage detected