async function createUser(user) {
    const hashedPassword = await bcrypt.hash(user.password, 10);
    user.password = hashedPassword;

    let createdUser = await userRepository.createUser(user);
    await earthRepository.createEarth({name : createdUser.dataValues.username + '\'s Earth', score : 0}, createdUser.dataValues)
    return createUser;
}
/*
* This method communicates with the repository and will
* create the specified user.
* @author Ruben Fricke
*/
This method communicates with the repository and will
create the specified user.
This method communicates with the repository and will create the specified user .
async function createUser(user) {
    const hashedPassword = await bcrypt.hash(user.password, 10);
    user.password = hashedPassword;
    let createdUser = await userRepository.createUser(user);
    await earthRepository.createEarth({name : createdUser.dataValues.username + '\'s Earth', score : 0}, createdUser.dataValues)
    return createUser;
}
async function createUser ( user ) { const hashedPassword = await bcrypt . hash ( user . password , 10 ) ; user . password = hashedPassword ; let createdUser = await userRepository . createUser ( user ) ; await earthRepository . createEarth ( { name : createdUser . dataValues . username + '\'s Earth' , score : 0 } , createdUser . dataValues ) return createUser ; }
This method communicates with the repository and will
create the specified user.
This method communicates with the repository and will create the specified user .