-
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
API routes & functions considerations #3
Comments
For the user profile, we need following routes to post and delete:
To create and update an user recipe, we need:
To get all those information, we already have the endpoint auth/me, to get the current user! We also need an element endpoint for the different allergies (e.g. lactose, glucose) And And last but not least, depending on the data schema, we will need an endpoint to rate substitute according to user feedback (e.g. I like the substitue, I do not like the substitute...) |
User endpoints added to checklist 👍
You mean the user-based allergies, lifestyle & goals right? (e.g. /user/:id/allergies)
This is not part of the model yet. In my opinion this should be part of "UserRecipe"-model right? |
You are right, it should be!
Exactly, a user needs to select a goal, lifestyle and allergies from a list of possible values. Those values, e.g. all goals, should be in the database and accessible like recipes or ingredients. :) So that, by calling /user/:id/goal/:id I can add the goal id from the goal endpoint to the user object. |
Got this 👍 i will create a separate issue for the user-related endpoints. Regarding
😃 |
If we'd model it this way, we would use the id ambiguously. Suggestion: or even easier (as you'll send me an object in the body of the request anyway): |
Implementation as:
We don't need to explicitly set |
Added description of this in original post. We need to keep in mind to remove all |
Please comment your required endpoints and their functionality below this issue.
I will split them into multiple issues once we gathered some endpoints.
Current top-level routes are:
From my point of view there would be one route i would like to add:
For the user profile, we need following routes to post and delete:
aggregated in issue #5
To create and update a user recipe, we need:
aggregated in issue #7
Further improvement:
All userId related endpoints will be replaced.
Reason:
The user id is provided with after validating the access token. Selection via req.params is therefore not necessary and can be replaced:
See #9 for this
The text was updated successfully, but these errors were encountered: