function removeEmployee(){
    connection.query("SELECT * FROM employee", function (err, res){
        if(err) throw err;
    inquirer.prompt([
        {
            type: "list",
            name: "employee",
            message: "Which employee do you want to remove?",
            choices: res.map((employee) => `${employee.first_name} ${employee.last_name}`)
        }
    ])
    .then((toRemove) =>{
        connection.query('DELETE FROM employee WHERE ?',
        {
            first_name: toRemove.first_name,
            // last_name: toRemove.last_name
        },
        function(err, res) {
            if(err) throw err;
            console.log("Removed an employee");
            question1Prompt();
        })
    })
    


    
    });
}
//This question should come after the user wants to remove an employee
This question should come after the user wants to remove an employee
This question should come after the user wants to remove an employee
function removeEmployee(){
    connection.query("SELECT * FROM employee", function (err, res){
        if(err) throw err;
    inquirer.prompt([
        {
            type: "list",
            name: "employee",
            message: "Which employee do you want to remove?",
            choices: res.map((employee) => `${employee.first_name} ${employee.last_name}`)
        }
    ])
    .then((toRemove) =>{
        connection.query('DELETE FROM employee WHERE ?',
        {
            first_name: toRemove.first_name,
        },
        function(err, res) {
            if(err) throw err;
            console.log("Removed an employee");
            question1Prompt();
        })
    })
    });
}
function removeEmployee ( ) { connection . query ( "SELECT * FROM employee" , function ( err , res ) { if ( err ) throw err ; inquirer . prompt ( [ { type : "list" , name : "employee" , message : "Which employee do you want to remove?" , choices : res . map ( ( employee ) => ` ${ employee . first_name } ${ employee . last_name } ` ) } ] ) . then ( ( toRemove ) => { connection . query ( 'DELETE FROM employee WHERE ?' , { first_name : toRemove . first_name , } , function ( err , res ) { if ( err ) throw err ; console . log ( "Removed an employee" ) ; question1Prompt ( ) ; } ) } ) } ) ; }
This question should come after the user wants to remove an employee
This question should come after the user wants to remove an employee
// last_name: toRemove.last_name