Repository navigation
Add reset user password action - #1320
Conversation
Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
… bq/update-user-password
Codecov Report
@@ Coverage Diff @@
## main #1320 +/- ##
==========================================
+ Coverage 58.09% 66.48% +8.39%
==========================================
Files 282 284 +2
Lines 18521 18569 +48
Branches 231 235 +4
==========================================
+ Hits 10759 12345 +1586
+ Misses 6601 4959 -1642
- Partials 1161 1265 +104
Continue to review full report at Codecov.
|
| createUserSuccess: "Successfully created user.", | ||
| suspendUserSuccess: "Successfully suspended the user.", | ||
| suspendUserError: "Error on suspend the user", | ||
| suspendUserError: "Error on suspend the user.", |
| | { type: "CONFIRM_USER_SUSPENSION" } | ||
| | { type: "CANCEL_USER_SUSPENSION" } | ||
| // Reset password events | ||
| | { type: "RESET_USER_PASSWORD"; userId: TypesGen.User["id"] } |
There was a problem hiding this comment.
I like how you use TypesGen.User["id"], we should do that more
| const { users, getUsersError, userIdToSuspend, userIdToResetPassword, newUserPassword } = usersState.context | ||
| const navigate = useNavigate() | ||
| const userToBeSuspended = users?.find((u) => u.id === userIdToSuspend) | ||
| const userToResetPassword = users?.find((u) => u.id === userIdToResetPassword) |
There was a problem hiding this comment.
In the future we may want to find a way to make the XService give the component the user instead of the user id, but this is fine for now.
There was a problem hiding this comment.
Yes, I've been wondering about that, instead of passing a userId, we could just send the full user object to make things easier but it makes it hard to sync, if we need it, in case the same user is updated by any other action. Using the ID we keep the reference to the user in the list which is always updated since it is the source of the truth. Makes sense?
Closes #733