async function createEvent(event) {
    console.info("Creating event");
    return await Event.create({
        name: event.name,
        description: event.description,
        points: event.points
    }).then((createdEvent) => {
        return createdEvent;
    }).catch((err) => {
        if (err) {
            console.warn(err);
            return(err);
        }
    });
}
/*
* This method communicates with the database and will
* create the specified event into the database.
* @author Ruben Fricke
*/
This method communicates with the database and will
create the specified event into the database.
This method communicates with the database and will create the specified event into the database .
async function createEvent(event) {
    console.info("Creating event");
    return await Event.create({
        name: event.name,
        description: event.description,
        points: event.points
    }).then((createdEvent) => {
        return createdEvent;
    }).catch((err) => {
        if (err) {
            console.warn(err);
            return(err);
        }
    });
}
async function createEvent ( event ) { console . info ( "Creating event" ) ; return await Event . create ( { name : event . name , description : event . description , points : event . points } ) . then ( ( createdEvent ) => { return createdEvent ; } ) . catch ( ( err ) => { if ( err ) { console . warn ( err ) ; return ( err ) ; } } ) ; }
This method communicates with the database and will
create the specified event into the database.
This method communicates with the database and will create the specified event into the database .