async function createEarth(earth, user) {
    console.info("Creating earth");
    return await Earth.create({
        name: earth.name,
        score: earth.score,
        userId: user.id
    }).then((createdEarth) => {
        return createdEarth;
    }).catch((err) => {
        if (err) {
            console.warn(err);
            return(err);
        }
    });
}
/**
 * This method will communicate with the database and creates the earth for the user.
 * @param {The earth that wil be created} earth
 * @param {The user which own the earth} user
 */
This method will communicate with the database and creates the earth for the user.
@param {The earth that wil be created} earth
@param {The user which own the earth} user
This method will communicate with the database and creates the earth for the user . @param { The earth that wil be created } earth @param { The user which own the earth } user
async function createEarth(earth, user) {
    console.info("Creating earth");
    return await Earth.create({
        name: earth.name,
        score: earth.score,
        userId: user.id
    }).then((createdEarth) => {
        return createdEarth;
    }).catch((err) => {
        if (err) {
            console.warn(err);
            return(err);
        }
    });
}
async function createEarth ( earth , user ) { console . info ( "Creating earth" ) ; return await Earth . create ( { name : earth . name , score : earth . score , userId : user . id } ) . then ( ( createdEarth ) => { return createdEarth ; } ) . catch ( ( err ) => { if ( err ) { console . warn ( err ) ; return ( err ) ; } } ) ; }
This method will communicate with the database and creates the earth for the user.
This method will communicate with the database and creates the earth for the user .