alpha-version-dce-check-in-api
Version:
API for taking attendance and checking people in.
36 lines (30 loc) • 868 B
text/typescript
// Import live-grouper
import { getGroupAssignment } from 'dce-live-grouper';
// Import dce-reactkit
import { genRouteHandler, ParamType } from '../../../../dce-reactkit';
// Import types
import Router from '../../../types/Router';
/**
* Adding a POST endpoint to assign a student to a group,
* returns the group assignment number.
* Requires a GrouperRequest body.
* @author Benedikt Arnarsson
* @param app the Express app that we are adding the endpoint to.
*/
const addGetGroupAssignmentRoute = (
router: Router,
) => {
router.post(
'/group-assignment',
genRouteHandler({
paramTypes: {
grouperRequest: ParamType.JSON,
},
handler: async ({ params }) => {
const { grouperRequest } = params;
return getGroupAssignment(grouperRequest);
},
}),
);
};
export default addGetGroupAssignmentRoute;