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

[API] Endpoint for adding/updating user info #132

Open
Aksh-Bansal-dev opened this issue Jul 9, 2022 · 13 comments
Open

[API] Endpoint for adding/updating user info #132

Aksh-Bansal-dev opened this issue Jul 9, 2022 · 13 comments
Assignees
Labels
API to label task requiring changes in API

Comments

@Aksh-Bansal-dev
Copy link
Member

No description provided.

@Aksh-Bansal-dev Aksh-Bansal-dev added the API to label task requiring changes in API label Jul 9, 2022
@PranshuNayak PranshuNayak self-assigned this Jul 9, 2022
@Samy-33 Samy-33 added this to Gymkhana Jul 10, 2022
@Samy-33
Copy link
Member

Samy-33 commented Jul 14, 2022

@PranshuNayak, I am removing this assignment as there are few others assigned to you which you can work on and others can take these tasks up.

@arminpatel
Copy link
Member

I'm working on this.

@arminpatel
Copy link
Member

arminpatel commented Jul 14, 2022

I'm a little confused which model is to be serialized for the endpoint.
Should I create a serializer for only User model or for all of them (Student, Faculty and Staff)?
Or should I create serializer for Student, Faculty and Staff and add extra fields to them (like name, email etc)?, imo this seems better.

@Samy-33
Copy link
Member

Samy-33 commented Jul 15, 2022

How about creating a serializer for User, and have three fields in it for student, faculty, staff.

This is nested serialization: https://www.django-rest-framework.org/api-guide/relations/#nested-relationships

@arminpatel
Copy link
Member

How about creating a serializer for User, and have three fields in it for student, faculty, staff.

This is nested serialization: https://www.django-rest-framework.org/api-guide/relations/#nested-relationships

Exactly what I wanted. Thanks.

@arminpatel
Copy link
Member

Does this endpoint also creates users?

@Aksh-Bansal-dev
Copy link
Member Author

Yeah, you can create 2 endpoints one for updating and one for creating.

@Samy-33
Copy link
Member

Samy-33 commented Jul 15, 2022

@arminpatel raise 2 separate CLs. One for Create and another for Update

@arminpatel
Copy link
Member

raise 2 separate CLs

what are CLs? 😅

@Samy-33
Copy link
Member

Samy-33 commented Jul 15, 2022

what are CLs? 😅

Sorry, got confused between internal terminology and external. It's called a changelist same as pull request.

So raise two PRs separately for update and create.

@arminpatel
Copy link
Member

Who will have permission to update user?

@Aksh-Bansal-dev
Copy link
Member Author

Who will have permission to update user?

I think only the user should have permission to edit their profile details.

@Samy-33
Copy link
Member

Samy-33 commented Jul 16, 2022

I think only the user should have permission to edit their profile details.

Admin user should have permission to edit user information as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API to label task requiring changes in API
Projects
Status: No status
Development

No branches or pull requests

4 participants