function promptInit() {
  const questionsNew = [
    {
      type: 'rawlist',
      message: 'Would you like to do?',
      name: 'action',
      choices: [
        { name: 'View All Employees', value: 'view-emp' },
        { name: 'Add Employee', value: 'add-emp' },
        { name: 'Update Employee Role', value: 'upd-emp' },
        { name: 'View All Roles', value: 'view-role' },
        { name: 'Add Role', value: 'add-role' },
        { name: 'View All Departments', value: 'view-dept' },
        { name: 'Add Department', value: 'add-dept' },
        { name: 'Quit', value: 'quit' },
      ]
    },
  ];
  console.log('Welcome to the Employee Tracker. Please enter an action below.');
  inquirer
    .prompt(questionsNew)
    .then((data) => {
      switch (data.action) {
        case 'view-emp': return showEmployees();
        case 'add-emp': return addEmployee();
        case 'upd-emp': return updateEmployee();
        case 'view-role': return showRole();
        case 'add-role': return addRole();
        case 'view-dept': return showDept();
        case 'add-dept': return addDept();
        case 'quit': return console.log('Goodbye!');
      };
    })
    .catch((err) => { console.log(err) });
}
// Initializes main menu prompt and triggers action
Initializes main menu prompt and triggers action
Initializes main menu prompt and triggers action
function promptInit() {
  const questionsNew = [
    {
      type: 'rawlist',
      message: 'Would you like to do?',
      name: 'action',
      choices: [
        { name: 'View All Employees', value: 'view-emp' },
        { name: 'Add Employee', value: 'add-emp' },
        { name: 'Update Employee Role', value: 'upd-emp' },
        { name: 'View All Roles', value: 'view-role' },
        { name: 'Add Role', value: 'add-role' },
        { name: 'View All Departments', value: 'view-dept' },
        { name: 'Add Department', value: 'add-dept' },
        { name: 'Quit', value: 'quit' },
      ]
    },
  ];
  console.log('Welcome to the Employee Tracker. Please enter an action below.');
  inquirer
    .prompt(questionsNew)
    .then((data) => {
      switch (data.action) {
        case 'view-emp': return showEmployees();
        case 'add-emp': return addEmployee();
        case 'upd-emp': return updateEmployee();
        case 'view-role': return showRole();
        case 'add-role': return addRole();
        case 'view-dept': return showDept();
        case 'add-dept': return addDept();
        case 'quit': return console.log('Goodbye!');
      };
    })
    .catch((err) => { console.log(err) });
}
function promptInit ( ) { const questionsNew = [ { type : 'rawlist' , message : 'Would you like to do?' , name : 'action' , choices : [ { name : 'View All Employees' , value : 'view-emp' } , { name : 'Add Employee' , value : 'add-emp' } , { name : 'Update Employee Role' , value : 'upd-emp' } , { name : 'View All Roles' , value : 'view-role' } , { name : 'Add Role' , value : 'add-role' } , { name : 'View All Departments' , value : 'view-dept' } , { name : 'Add Department' , value : 'add-dept' } , { name : 'Quit' , value : 'quit' } , ] } , ] ; console . log ( 'Welcome to the Employee Tracker. Please enter an action below.' ) ; inquirer . prompt ( questionsNew ) . then ( ( data ) => { switch ( data . action ) { case 'view-emp' : return showEmployees ( ) ; case 'add-emp' : return addEmployee ( ) ; case 'upd-emp' : return updateEmployee ( ) ; case 'view-role' : return showRole ( ) ; case 'add-role' : return addRole ( ) ; case 'view-dept' : return showDept ( ) ; case 'add-dept' : return addDept ( ) ; case 'quit' : return console . log ( 'Goodbye!' ) ; } ; } ) . catch ( ( err ) => { console . log ( err ) } ) ; }
Initializes main menu prompt and triggers action
Initializes main menu prompt and triggers action