alpha-version-dce-check-in-ui
Version:
UI for taking attendance and checking people in.
28 lines (24 loc) • 717 B
text/typescript
// Import types
import Occurrence from '../../../shared/types/Occurrence';
import VisitServerEndpoint from '../../../types/VisitServerEndpoint';
// Import constants
import TTM_PATH_PREFIX from '../../../shared/constants/TTM_PATH_PREFIX';
/**
* Create a new occurrence document in the database.
* @author Benedikt Arnarsson
* @param occ the occurrence that is being placed in the DB
*/
const putNewOccurrence = async (
visitServerEndpoint: VisitServerEndpoint,
occ: Occurrence,
) => {
// FIXME: error handling
await visitServerEndpoint({
path: `${TTM_PATH_PREFIX}/occurrence`,
method: 'POST',
params: {
occurrence: JSON.stringify(occ),
},
});
};
export default putNewOccurrence;