bamazonManager.js
//When a manager needs to add new item
When a manager needs to add new item
When a manager needs to add new item
function addingNewItemID(item){
    inquirer.prompt([{
        type: 'input',
        name: 'product_name',
        message: "What is the product's name?"
    },
    {
        type: 'input',
        name: 'department_name',
        message: "Which department do you assign this product to?"
    },
    {
        type: 'input',
        name: 'price',
        message: "Price?"
    },
    {
        type: 'input',
        name: 'stock_quantity',
        message: "How many units do you wish to add?"
    }
]).then(function(val){
    console.log (val);
 let query = "INSERT INTO products (product_name, department_name, price, stock_quantity) VALUES (?, ?, ?, ?)"
connection.query(query, 
    [val.product_name, val.department_name, val.price, val.stock_quantity],
    function(err, res) {
    console.log(res)})
     });
}
function addingNewItemID ( item ) { inquirer . prompt ( [ { type : 'input' , name : 'product_name' , message : "What is the product's name?" } , { type : 'input' , name : 'department_name' , message : "Which department do you assign this product to?" } , { type : 'input' , name : 'price' , message : "Price?" } , { type : 'input' , name : 'stock_quantity' , message : "How many units do you wish to add?" } ] ) . then ( function ( val ) { console . log ( val ) ; let query = "INSERT INTO products (product_name, department_name, price, stock_quantity) VALUES (?, ?, ?, ?)" connection . query ( query , [ val . product_name , val . department_name , val . price , val . stock_quantity ] , function ( err , res ) { console . log ( res ) } ) } ) ; }
When a manager needs to add new item
When a manager needs to add new item
// adding prompts for the new item's profile: product_name, department_name, price, stock_quantity  // the manager's input needs to be added to the quantity and then the table should print with a new quantity. "INSERT INTO table_name //(column1, column2, column3, ...) //VALUES (value1, value2, value3, ...);