Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

test(site): move users page test to storybook#14579

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
BrunoQuaresma merged 13 commits intomainfrombq/fix-users-page-test
Sep 6, 2024
Merged
Changes from1 commit
Commits
Show all changes
13 commits
Select commitHold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
NextNext commit
Fix lint
  • Loading branch information
@BrunoQuaresma
BrunoQuaresma committedSep 5, 2024
commit219716db4a9dc48d04a1305bdb6cf18a4db80e13
22 changes: 17 additions & 5 deletionssite/src/pages/UsersPage/UsersPage.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -172,8 +172,11 @@ const UsersPage: FC = () => {
entity="user"
onCancel={() => setUserToDelete(undefined)}
onConfirm={async () => {
if (!userToDelete) {
return;
}
try {
await deleteUserMutation.mutateAsync(userToDelete!.id);
await deleteUserMutation.mutateAsync(userToDelete.id);
setUserToDelete(undefined);
displaySuccess("Successfully deleted the user.");
} catch (e) {
Expand All@@ -191,8 +194,11 @@ const UsersPage: FC = () => {
confirmText="Suspend"
onClose={() => setUserToSuspend(undefined)}
onConfirm={async () => {
if (!userToSuspend) {
return;
}
try {
await suspendUserMutation.mutateAsync(userToSuspend!.id);
await suspendUserMutation.mutateAsync(userToSuspend.id);
setUserToSuspend(undefined);
displaySuccess("Successfully suspended the user.");
} catch (e) {
Expand All@@ -216,8 +222,11 @@ const UsersPage: FC = () => {
confirmText="Activate"
onClose={() => setUserToActivate(undefined)}
onConfirm={async () => {
if (!userToActivate) {
return;
}
try {
await activateUserMutation.mutateAsync(userToActivate!.id);
await activateUserMutation.mutateAsync(userToActivate.id);
setUserToActivate(undefined);
displaySuccess("Successfully activated the user.");
} catch (e) {
Expand All@@ -242,10 +251,13 @@ const UsersPage: FC = () => {
setConfirmResetPassword(undefined);
}}
onConfirm={async () => {
if (!confirmResetPassword) {
return;
}
try {
await updatePasswordMutation.mutateAsync({
userId: confirmResetPassword!.user.id,
password: confirmResetPassword!.newPassword,
userId: confirmResetPassword.user.id,
password: confirmResetPassword.newPassword,
old_password: "",
});
setConfirmResetPassword(undefined);
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp