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

Function addModifyProgram

src/Data/ProgramData.js:261–278  ·  view source on GitHub ↗
(requestBody)

Source from the content-addressed store, hash-verified

259}
260
261export async function addModifyProgram(requestBody) {
262 /*
263 * Set the program (with description) to the local storage (i.e. localforage.getItem('programs') and localforage.getItem(`${programId}-Desc`), and post to the server.
264 * @param program [Object]: program (with description)
265 */
266 let content = requestBody.content;
267 if (!requestBody.newProgram) {
268 const originalProgram = await getProgram(content.ProgramID);
269 content = {...content, Applicants: originalProgram.Applicants};
270 }
271 await apiRequest(ADD_MODIFY_PROGRAM, {
272 body: {
273 newProgram: requestBody.newProgram,
274 content,
275 },
276 });
277 await setProgramContent(content);
278}
279
280function normalizeQueryValues(value) {
281 const values = typeof value === 'string' ? value.split(',').filter(Boolean) : value;

Callers 1

actionFunction · 0.90

Calls 3

apiRequestFunction · 0.90
getProgramFunction · 0.85
setProgramContentFunction · 0.85

Tested by

no test coverage detected