async function updateEmployeeManager() {
    var employeeChoices = await db.employeeQuery;
    var managerChoices = await db.managerQuery;
    prompt([
        {
            type: 'list',
            name: 'employee',
            choices: employeeChoices,
            message: "Which employee would you like to update?"
        },
        {
            type: 'list',
            name: 'manager',
            choices: managerChoices,
            message: "What is the employee's new manager?"
        }
    ]).then(async answer => {
        console.log(answer.employee + "'s manager has been updated to " + answer.manager + '.');
        const employeeId = await db.employeeIdQuery(answer.employee);
        const newManagerId = answer.manager === "None" ? null : await managerIdQuery(answer.manager);
        const query = connection.query('UPDATE employees SET ? WHERE id=?',
            [{
                manager_id: newManagerId
            },
                employeeId], (err, res) => {
                    if (err) throw err;
                    loadMainPrompts();
            });
    })
}
// update an employee's manager
update an employee's manager
update an employee ' s manager
async function updateEmployeeManager() {
    var employeeChoices = await db.employeeQuery;
    var managerChoices = await db.managerQuery;
    prompt([
        {
            type: 'list',
            name: 'employee',
            choices: employeeChoices,
            message: "Which employee would you like to update?"
        },
        {
            type: 'list',
            name: 'manager',
            choices: managerChoices,
            message: "What is the employee's new manager?"
        }
    ]).then(async answer => {
        console.log(answer.employee + "'s manager has been updated to " + answer.manager + '.');
        const employeeId = await db.employeeIdQuery(answer.employee);
        const newManagerId = answer.manager === "None" ? null : await managerIdQuery(answer.manager);
        const query = connection.query('UPDATE employees SET ? WHERE id=?',
            [{
                manager_id: newManagerId
            },
                employeeId], (err, res) => {
                    if (err) throw err;
                    loadMainPrompts();
            });
    })
}
async function updateEmployeeManager ( ) { var employeeChoices = await db . employeeQuery ; var managerChoices = await db . managerQuery ; prompt ( [ { type : 'list' , name : 'employee' , choices : employeeChoices , message : "Which employee would you like to update?" } , { type : 'list' , name : 'manager' , choices : managerChoices , message : "What is the employee's new manager?" } ] ) . then ( async answer => { console . log ( answer . employee + "'s manager has been updated to " + answer . manager + '.' ) ; const employeeId = await db . employeeIdQuery ( answer . employee ) ; const newManagerId = answer . manager === "None" ? null : await managerIdQuery ( answer . manager ) ; const query = connection . query ( 'UPDATE employees SET ? WHERE id=?' , [ { manager_id : newManagerId } , employeeId ] , ( err , res ) => { if ( err ) throw err ; loadMainPrompts ( ) ; } ) ; } ) }
update an employee's manager
update an employee ' s manager