bamazonManager.js
//prompt manager for menu option -an array of strings is assigned to the variable menuOptions
prompt manager for menu option -an array of strings is assigned to the variable menuOptions
prompt manager for menu option - an array of strings is assigned to the variable menuOptions
function managerMenu(){
    let menuOptions = ["View Products for Sale", "View Low Inventory", "Add to Inventory","Add New Product",]
    inquirer.prompt([{
        type: 'list',
        name: 'choice',
        choices: menuOptions,
        message: "Select one of the options"
    }]).then(function(val) {
    console.log("inquirer ran");
    console.log(val.choice);
    if (val.choice == menuOptions[0]) {
        viewProducts();
         }
    if (val.choice == menuOptions[1]) {
            viewLowInventory();
        }
    if (val.choice == menuOptions[2]) {
        addtoInventory();  
         }
    if (val.choice == menuOptions[3]) {
    addingNewItemID();
        }  
    })
}
function managerMenu ( ) { let menuOptions = [ "View Products for Sale" , "View Low Inventory" , "Add to Inventory" , "Add New Product" , ] inquirer . prompt ( [ { type : 'list' , name : 'choice' , choices : menuOptions , message : "Select one of the options" } ] ) . then ( function ( val ) { console . log ( "inquirer ran" ) ; console . log ( val . choice ) ; if ( val . choice == menuOptions [ 0 ] ) { viewProducts ( ) ; } if ( val . choice == menuOptions [ 1 ] ) { viewLowInventory ( ) ; } if ( val . choice == menuOptions [ 2 ] ) { addtoInventory ( ) ; } if ( val . choice == menuOptions [ 3 ] ) { addingNewItemID ( ) ; } } ) }
prompt manager for menu option -an array of strings is assigned to the variable menuOptions
prompt manager for menu option - an array of strings is assigned to the variable menuOptions
//let allOptionsString = ""; //creating a giant string with a list of all of our options //menuOptions.forEach(function(n){ allOptionsString += n+'\n' }) //display a set of menu options // change the above from 'input' to 'list' so that we can have a responsive list. // in the msg, want to display each menu option to the manager using a foreach loop //consolelogging the val to confirm the inquirer is doing the work in the background. A check to see what the inquirer is doing...  //check if the user input is 'view products for sale'  // then run the view products function- Manager needs to see: the item IDs, names, prices, and quantities // then run the view products function- Manager needs to see: the item IDs, names, prices, and quantities //run Add to Inventory //run Add to Inventory