-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: main
Are you sure you want to change the base?
Conversation
else if (req.method === 'DELETE' && isUserHobby(url)) { | ||
await deleteUserHobby(req, res); | ||
} | ||
else if (req.method === 'GET' && isHobby(url)) { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
функции по ошибкам, тоже можно в utils перенести
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Поняла, спасибо большое!
Подправлю
No description provided.