-
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
Adding the users' crud endpoints #19
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.
doesn't quite complete the issue at this point, /users/me endpoint and authorization missing
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Did some refactors here and there. I've got some questions: which roles can use the specific endpoints? And where should the decorators be used? In the controller or the service, because in Bujdi's PR I saw they were used in the service |
@Patch(':id') | ||
@UseGuards(AuthGuard('jwt'), RolesGuard) | ||
@Roles(Role.BODY_ADMIN) | ||
async update(@Param('id') id: string, @Body() updateUserDto: UpdateUserDto) { |
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.
I think we need to add the option for the user to update their own profile also. For eg nickname or profile description should be for sure editable. But on the other hand, schresident and vik student should be managed by admins.
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.
But these are only for schbody members, right? No point in regular users having nicknames and stuff
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.
Ohh, that is fair. I forgot about that
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.
so @Dkrisztan I think body members should be able to edit their own nickname and description
and body members and admins should be able to edit the schResident and vikStudent fields (if this is what they'll use during belépőosztás. or maybe I'm confused)
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.
The first part makes sense, the second not really 😅 . So body members can edit nickname desc and resident and vikstudent fields as well?
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.
Since we are not able to check who lives in the dorm and who does not, we agreed on all users will be able to edit their email, sch-status (room number also) as some kind of a self-declaration. Or at least, it is what I remember.
Now the profile page also has a nickname field (for all users), it is very useful for the symetry of the UI :), do you think it is unneccessary?
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.
Nope. makes sense I just didn't understand the difference between the admin and member role, regarding this update. This fix will be up later this day.
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.
I don't see the point of a nickname and description for regular users, their profile won't even be public, right? or are we planning on turning this app into a workout social network? xd
makes sense that the user can set their schStatus and roomNumber, but then the body members should be able to edit another flag that the sch residency was approved during the belepoosztas. Or I guess that could be unnecessary, they just simply don't give them their pass if it wasn't approved
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.
Yes
still waiting for a reply on this one 😅 not sure what should be followed |
decorators are only used in the controller, Bujdi's PR had comments to remove them from the service xd |
I would put the decorators in the controller, as well |
oh maaan, Samu was quicker than me |
apps/backend/package.json
Outdated
@@ -21,6 +21,7 @@ | |||
"@nestjs/passport": "^10.0.3", | |||
"@nestjs/platform-express": "^10.3.8", | |||
"@prisma/client": "^5.13.0", | |||
"class-transformer": "^0.5.1", |
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.
lmao why was this missing
… for admin and member
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.
én már elvesztem de most már biztos jó
So far this is only a sketch, not everything is implemented, authorization and authentication annotations are not yet used.
Let me know if changes are needed in these files etc.