src/server/controllers/home-controller.js
/**
* Checks if user exists with same email as home.  If not, it creates a new User with the email provided and a default password. Then creates the Home to reside in the new user
* @returns {Home}
*/
Checks if user exists with same email as home.  If not, it creates a new User with the email provided and a default password. Then creates the Home to reside in the new user
Checks if user exists with same email as home . If not it creates a new User with the email provided and a default password . Then creates the Home to reside in the new user
function create(req, res, next) {
    const home = new Home(req.body)
        .save()
        .then(savedHome => res.json(savedHome))
        .catch(e => next(e));
}
function create ( req , res , next ) { const home = new Home ( req . body ) . save ( ) . then ( savedHome => res . json ( savedHome ) ) . catch ( e => next ( e ) ) ; }
Checks if user exists with same email as home.
Checks if user exists with same email as home .