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

Add service with get, post, delete requests #5

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

kandalova
Copy link
Owner

No description provided.

else if (req.method === 'DELETE' && isUserHobby(url)) {
await deleteUserHobby(req, res);
}
else if (req.method === 'GET' && isHobby(url)) {
Copy link

Choose a reason for hiding this comment

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

супер, что добавила проверку на входящие параметры

@@ -0,0 +1,9 @@
export const hateoasify = (arr, hateoas)=>{
return arr.map(item=>{
return {
Copy link

Choose a reason for hiding this comment

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

верно

return true;
}

const throwUserError = (id) => {
Copy link

Choose a reason for hiding this comment

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

функции по ошибкам, тоже можно в utils перенести

Copy link
Owner Author

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