UNPKG

alpha-version-dce-check-in-api

Version:

API for taking attendance and checking people in.

25 lines (20 loc) 619 B
// Import collections import { getOccurrenceCollection } from '../../initCollections'; // Import shared types import Occurrence from '../types/Occurrence'; // Import shared helpers import genOccurrenceId from './genOccurrenceId'; /** * Add an occurrence to the db * @author Gabe Abrams * @author Ben Arnarsson * @param occurrence the occurrence to add */ const createOccurrence = async (occurrence: Occurrence) => { const occurrenceCollection = getOccurrenceCollection(); await occurrenceCollection.insert({ id: genOccurrenceId(occurrence), ...occurrence, }); }; export default createOccurrence;