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

Function action

src/Components/ProgramPage/ProgramPage.jsx:19–32  ·  view source on GitHub ↗
({request})

Source from the content-addressed store, hash-verified

17}
18
19export async function action({request}) {
20 const formData = await request.formData();
21 const actionType = formData.get("ActionType");
22 const programId = formData.get("ProgramID");
23 if (actionType === "Star") {
24 await collectProgram(programId);
25 return redirect(request.url);
26 }
27 if (actionType === "UnStar") {
28 await uncollectProgram(programId);
29 return redirect(request.url);
30 }
31 return getPrograms(true);
32}
33
34export default function ProgramPage() {
35 const loaderData = useLoaderData();

Callers

nothing calls this directly

Calls 3

collectProgramFunction · 0.90
uncollectProgramFunction · 0.90
getProgramsFunction · 0.90

Tested by

no test coverage detected