function menu() {
    inquirer
        .prompt({
            name: 'action',
            type: 'list',
            message: 'Welcome to your employee database, please chose from one of the options below',
            choices:
            [
                'View Employees',
                'View Departments',
                'View Roles',
                'Add an Employee',
                'Add a Department',
                'Add a Role',
                'Update Employees Role',
                'Delete Employee',
                'Delete Department',
                'Delete Role',
                'EXIT database'
            ]
        //Creating switch cases that determine the next function depending on the selection of the above choices from the  user
        }).then(function(answer)
        {
            switch(answer.action){
                case 'View Employees':
                    viewEmployees();
                    break;
                case 'View Departments':
                    viewDepartments();
                    break;
                case 'View Roles':
                    viewRoles();
                    break;
                case 'Add an Employee':
                    addEmployee();
                    break;
                case 'Add a Department':
                    addDepartment();
                    break;
                case 'Add a Role':
                    addRole();
                    break;
                case 'Update Employees Role':
                    updateRole();
                    break;
                case 'Delete Employee':
                    deleteEmployee();
                    break;
                case 'Delete Department':
                    deleteDepartment();
                    break;
                case 'Delete Role':
                    deleteRole();
                    break;
                case 'EXIT database':
                    exit();
                    break;
                default:
                    break;
            }
        })
}
//Create funciton that asks the user to chose from a series of options
Create funciton that asks the user to chose from a series of options
Create funciton that asks the user to chose from a series of options
function menu() {
    inquirer
        .prompt({
            name: 'action',
            type: 'list',
            message: 'Welcome to your employee database, please chose from one of the options below',
            choices:
            [
                'View Employees',
                'View Departments',
                'View Roles',
                'Add an Employee',
                'Add a Department',
                'Add a Role',
                'Update Employees Role',
                'Delete Employee',
                'Delete Department',
                'Delete Role',
                'EXIT database'
            ]
        }).then(function(answer)
        {
            switch(answer.action){
                case 'View Employees':
                    viewEmployees();
                    break;
                case 'View Departments':
                    viewDepartments();
                    break;
                case 'View Roles':
                    viewRoles();
                    break;
                case 'Add an Employee':
                    addEmployee();
                    break;
                case 'Add a Department':
                    addDepartment();
                    break;
                case 'Add a Role':
                    addRole();
                    break;
                case 'Update Employees Role':
                    updateRole();
                    break;
                case 'Delete Employee':
                    deleteEmployee();
                    break;
                case 'Delete Department':
                    deleteDepartment();
                    break;
                case 'Delete Role':
                    deleteRole();
                    break;
                case 'EXIT database':
                    exit();
                    break;
                default:
                    break;
            }
        })
}
function menu ( ) { inquirer . prompt ( { name : 'action' , type : 'list' , message : 'Welcome to your employee database, please chose from one of the options below' , choices : [ 'View Employees' , 'View Departments' , 'View Roles' , 'Add an Employee' , 'Add a Department' , 'Add a Role' , 'Update Employees Role' , 'Delete Employee' , 'Delete Department' , 'Delete Role' , 'EXIT database' ] } ) . then ( function ( answer ) { switch ( answer . action ) { case 'View Employees' : viewEmployees ( ) ; break ; case 'View Departments' : viewDepartments ( ) ; break ; case 'View Roles' : viewRoles ( ) ; break ; case 'Add an Employee' : addEmployee ( ) ; break ; case 'Add a Department' : addDepartment ( ) ; break ; case 'Add a Role' : addRole ( ) ; break ; case 'Update Employees Role' : updateRole ( ) ; break ; case 'Delete Employee' : deleteEmployee ( ) ; break ; case 'Delete Department' : deleteDepartment ( ) ; break ; case 'Delete Role' : deleteRole ( ) ; break ; case 'EXIT database' : exit ( ) ; break ; default : break ; } } ) }
Create funciton that asks the user to chose from a series of options
Create funciton that asks the user to chose from a series of options
//Creating switch cases that determine the next function depending on the selection of the above choices from the  user