Merged PR 571: アカウント画面で管理者設定している箇所の対応
## 概要 [Task3054: アカウント画面で管理者設定している箇所の対応](https://paruru.nds-tyo.co.jp:8443/tfs/ReciproCollection/fa4924a4-d079-4fab-9fb5-a9a11eb205f0/_workitems/edit/3054) - アカウント画面での管理者設定でEmail認証していないユーザーを設定しないように対応しました。 - 管理者選択のドロップダウンに表示されるユーザーをクライアント側で認証済みでフィルタする対応 - アカウント情報更新APIで管理者に未認証ユーザーを設定しようとするとエラーとなるように修正 ## レビューポイント - ユーザー取得は画面側でフィルタしているが対応としては適切でしょうか? - 同じAPIをフィルタせずに使うところもあるため ## UIの変更 - なし ## 動作確認状況 - ローカルで確認
This commit is contained in:
parent
7c16e7c358
commit
e228d06cc7
@ -1,4 +1,4 @@
|
||||
import { Dealer } from "api/api";
|
||||
import { Dealer, User } from "api/api";
|
||||
import { RootState } from "app/store";
|
||||
|
||||
export const selectAccountInfo = (state: RootState) =>
|
||||
@ -10,7 +10,8 @@ export const selectDealers = (state: RootState) => {
|
||||
const { country } = state.account.domain.getAccountInfo.account;
|
||||
return dealers.filter((x: Dealer) => x.country === country);
|
||||
};
|
||||
export const selectUsers = (state: RootState) => state.account.domain.users;
|
||||
export const selectUsers = (state: RootState) =>
|
||||
state.account.domain.users.filter((x: User) => x.emailVerified);
|
||||
export const selectIsLoading = (state: RootState) =>
|
||||
state.account.apps.isLoading;
|
||||
export const selectUpdateAccountInfo = (state: RootState) =>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { createAsyncThunk } from "@reduxjs/toolkit";
|
||||
import type { RootState } from "app/store";
|
||||
import { getAccessToken, setToken } from "features/auth";
|
||||
import { setToken } from "features/auth";
|
||||
import {
|
||||
AuthApi,
|
||||
UsersApi,
|
||||
|
||||
@ -886,11 +886,12 @@ export class AccountsRepositoryService {
|
||||
where: {
|
||||
id: primaryAdminUserId,
|
||||
account_id: myAccountId,
|
||||
email_verified: true,
|
||||
},
|
||||
});
|
||||
if (!primaryAdminUser) {
|
||||
throw new AdminUserNotFoundError(
|
||||
`Primary admin user is not found. id: ${primaryAdminUserId}, account_id: ${myAccountId}`,
|
||||
`Primary admin user is not found or email not verified. id: ${primaryAdminUserId}, account_id: ${myAccountId}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -901,11 +902,12 @@ export class AccountsRepositoryService {
|
||||
where: {
|
||||
id: secondryAdminUserId,
|
||||
account_id: myAccountId,
|
||||
email_verified: true,
|
||||
},
|
||||
});
|
||||
if (!secondryAdminUser) {
|
||||
throw new AdminUserNotFoundError(
|
||||
`Secondry admin user is not found. id: ${secondryAdminUserId}, account_id: ${myAccountId}`,
|
||||
`Secondary admin user is not found or email not verified. id: ${secondryAdminUserId}, account_id: ${myAccountId}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user