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