-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
feat: remove user from project 🙅 #1349
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Luke McFarlane <luke.mcfarlane@rocketlab.com.au>
Signed-off-by: Luke McFarlane <luke.mcfarlane@rocketlab.com.au>
Signed-off-by: Luke McFarlane <luke.mcfarlane@rocketlab.com.au>
Signed-off-by: Luke McFarlane <luke.mcfarlane@rocketlab.com.au>
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.
Just very few minor ones for error handling. Thanks!
|
||
const user = await getUserFromEmailOrUsername(req.params.user_id); | ||
|
||
if (!user) { |
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.
if user is not found, can we return a 404 response instead of internal server error?
<Button | ||
variant="destructive" | ||
className="w-full" | ||
onClick={async () => { |
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.
add a try-catch block please to handle any errors.
} | ||
); | ||
|
||
if (!response.ok) return; |
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.
also we can throw an error like Failed to remove user by displaying the appropriate message for the user.
JIRA Ticket
BSS-666
Description
Added the ability to remove users from a project.
Proposed Changes
How to Test
Additional Information
I have made it so that you cannot remove admins from surveys for now.
Checklist