You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was talking to Hunter about the current backend endpoints and I feel that we could have them be more readable. I realize this might be a nit-pick but it could make a big difference for consuming the api properly and having RESTFUL endpoints.
Here's an example of what they should look like:
gsndb/user/1/students
This url expresses that we should be on a page that shows user 1's students. Specifically all students associated with user 1's account. If we wanted to navigate to another user's students we should be able to change the primary key to say user/5/students in the url and be redirected to their students. Whether we want that functionality is another question. But our endpoints should be very explicit in where we are currently located in the application.
If you are unsure about my suggestion then I would be happy to talk about it over discord/github/in-person.
The text was updated successfully, but these errors were encountered:
Ok that makes sense! So are you saying you want user 1 to have access to user 2’s students? Right now the endpoints don’t have multi layers. It’s just students/1 or school/2. Thoughts??
Well it really depends on what we want the user to have access to but for this use case I'd say we don't want the user to have access to other user's students. I made that example to express how easy the url should be to read.
I realize we don't have nested routes right now but we should start thinking about which ones we should create so we can keep our endpoints RESTful on both the front and back end.
So we could always have the user in the url such as: gsndev.com/gsndb/:username
Then when they click on different tabs it would append the url: gsndev.com/gsndb/:username/students
With this example we've removed the users primary key and inserted the users first name into the url. We could keep doing this for other sections where it makes sense.
ex:
gsndev.com/gsndb/school/1/students
gsndev.com/gsndb/student/5/grades => You could also make slugs for the students like bthornton, where you take first initial and append the last name
All suggestions for what they could look like but our url should work similar to the breadcrumbs and almost be read as a sentence.
Ah okay makes sense to try and make them more restful.
Here are the current urls on the
Program/
Program/int
Student/
Student/int
School/
School/int
District/
District/int
Course/
Course/int
Are you saying for each of these you want me to put the username in front of it? I can do that! Just thinking that it seems unnecessary since it isn’t telling us more info? All of these urls will be split between all that they have access to and all that are their students. For that I will add in something before to identify. Just lmk your thought process/what you specifically want me to do!
I was talking to Hunter about the current backend endpoints and I feel that we could have them be more readable. I realize this might be a nit-pick but it could make a big difference for consuming the api properly and having RESTFUL endpoints.
Here's an example of what they should look like:
gsndb/user/1/students
This url expresses that we should be on a page that shows user 1's students. Specifically all students associated with user 1's account. If we wanted to navigate to another user's students we should be able to change the primary key to say user/5/students in the url and be redirected to their students. Whether we want that functionality is another question. But our endpoints should be very explicit in where we are currently located in the application.
If you are unsure about my suggestion then I would be happy to talk about it over discord/github/in-person.
The text was updated successfully, but these errors were encountered: