Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

task solution #237

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

Oleksandr2108
Copy link

No description provided.

Copy link

@BudnikOleksii BudnikOleksii left a comment

Choose a reason for hiding this comment

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

Looks good 👍
Just a few minor fixes are required

Comment on lines 11 to 12
app.use('/users', express.json(), usersRouter);
app.use('/expenses', express.json(), expensesRouter);

Choose a reason for hiding this comment

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

Suggested change
app.use('/users', express.json(), usersRouter);
app.use('/expenses', express.json(), expensesRouter);
app.use(express.json());
app.use('/users', usersRouter);
app.use('/expenses', expensesRouter);

You can apply to all routes at once

Comment on lines 2 to 8
// const getId = require('../utils/getMaxId');

// let users = [];

// const initUsers = () => {
// users = [];
// };

Choose a reason for hiding this comment

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

Remove comments

Comment on lines 1 to 12
function getCreateMaxId(array) {
if (array.length === 0) {
return 1;
} else {
const maxId = Math.max(...array.map((obj) => obj.id));

return maxId + 1;
}
}

module.exports = {
getCreateMaxId,

Choose a reason for hiding this comment

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

Remove as you don't need it anymore

Copy link

@BudnikOleksii BudnikOleksii left a comment

Choose a reason for hiding this comment

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

👍

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