Skip to content

Commit

Permalink
update employee debugging working thru errors
Browse files Browse the repository at this point in the history
  • Loading branch information
rdevans87 committed May 29, 2021
1 parent ab83e76 commit 2f618ce
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 5 deletions.
32 changes: 27 additions & 5 deletions employeeTracker.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,23 +144,45 @@ const viewEmployeesByManager = () => {
}

const updateEmployeeRole = () => {
connection.query('SELECT * FROM role', (err, roles) => {
connection.query('SELECT * FROM role', (err, employees) => {
if (err) console.log(err);
employees = employees.map((employee) => {
return {
name: `${employee.first_name} ${employee.last_name}`,
value: employee.id,
};
});
};
});
connection.query('SELECT * FROM role', (err, roles) => {
if (err) console.log(err);
roles = roles.map((role) => {
return {
name: role.title,
value: role.id,
}
});
inquirer.prompt([
{
type: 'list',
name: 'selectEmployee',
message: 'Select employee to update...',
choices: employees,
},
{
type: 'list',
name: 'selectNewRole',
message: 'Select new employee role...',
choices: 'roles',
},
])
.then(data) => {
connection.query(
'UPDATE employee SET ? WHERE?',
[


]

});

}

// BONUS: SQL to update employee by manager
const updateEmployeeManager = () => {
Expand Down
12 changes: 12 additions & 0 deletions settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{

// Controls if quick suggestions should show up while typing
"editor.quickSuggestions": {
"other": true,
"comments": false,
"strings": false
},

"editor.quickSuggestionsDelay": 15

}

0 comments on commit 2f618ce

Please sign in to comment.