-
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
Remove :register APIs for student and teacher #151
Conversation
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.
Similarly, for update and delete functions, we will be using update_student_with_user
and delete_student_with_user
.
Let's make these slight changes!
|
What I'm trying to say is, we have a PATCH /student API and the fucntion definition looks like:
So instead of updating only the student here, we can change it to update student along with the user! |
Now, db-service handles the creation of a new student/teacher. It first checks if the student/teacher already exists, if yes, then updates the student/teacher (along with user), otherwise creates a student/teacher (along with user).
Since student and teacher are coupled with user, any updating of student and teacher should also update the user.