(user: User)
| 142 | }; |
| 143 | |
| 144 | const handleRestore = async (user: User) => { |
| 145 | const accountType = getAccountTypeByEmail(user.email); |
| 146 | const fullName = getUserFullNameByType(user); |
| 147 | |
| 148 | try { |
| 149 | if (accountType === AccountType.SERVICE_ACCOUNT) { |
| 150 | await undeleteServiceAccount(fullName); |
| 151 | } else if (accountType === AccountType.WORKLOAD_IDENTITY) { |
| 152 | await undeleteWorkloadIdentity(fullName); |
| 153 | } else { |
| 154 | await restoreUser(fullName); |
| 155 | } |
| 156 | |
| 157 | const updated = create(UserSchema, { ...user, state: State.ACTIVE }); |
| 158 | onUserUpdated(updated); |
| 159 | |
| 160 | pushNotification({ |
| 161 | module: "bytebase", |
| 162 | style: "SUCCESS", |
| 163 | title: t("common.updated"), |
| 164 | }); |
| 165 | } catch { |
| 166 | // error already shown by store |
| 167 | } |
| 168 | }; |
| 169 | |
| 170 | const handleView = (user: User) => { |
| 171 | const accountType = getAccountTypeByEmail(user.email); |
no test coverage detected