Skip to content

Project ready for marking#1

Open
luizfroes wants to merge 31 commits intomainfrom
dev
Open

Project ready for marking#1
luizfroes wants to merge 31 commits intomainfrom
dev

Conversation

@luizfroes
Copy link
Copy Markdown
Owner

No description provided.

## Usage

To use the application follow the steps below:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this application requires any user to connect to the database, it would be good to include a step to tell them where to find the script to create the database and how to run this.

if (!departments.length) {
console.log("Please add a Department first!!");

return start();
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we're in the while loop still, you don't need to return this function and call it again, we can just return and it will start the loop again.

if (!roles.length) {
console.log("Please add a Role first!!");

return start();
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove all of these return start() statements as they are unnecessary and cause extra code to rerun when it's not needed.

);

//construct mysql view query ordered by manager
const query = await db.query(`SELECT
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could perhaps store these query strings in a utils file and import them to clean this file up a bit.

db.query(query);
}

if (chosenAction === "viewAllDepartments") {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For these three view actions, consider what happens when there is no data. Currently an empty table is generated. We should check this and handle it here with a console.log that tells the user there is no data to view.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants