Merged PR 104: ユーザ作成API呼び出し時に、アクセストークンを渡すように修正

## 概要
[Task1745: ユーザ作成API呼び出し時に、アクセストークンを渡すように修正](https://paruru.nds-tyo.co.jp:8443/tfs/ReciproCollection/fa4924a4-d079-4fab-9fb5-a9a11eb205f0/_workitems/edit/1745)

タスク 1745: ユーザ作成API呼び出し時に、アクセストークンを渡すように修正
ユーザ作成API4(signup)呼び出し時の引数にアクセストークンを追加。
(/app/dictation_client/src/features/user/operations.ts)

## レビューポイント
アクセストークンの渡し方が正しいかどうか
不足している処理はないか

## UIの変更
なし

## 動作確認状況
ローカルでの動作確認にてheader内にauthorizationが追加されたことを確認

## 補足
なし
This commit is contained in:
oura.a 2023-05-15 02:30:32 +00:00
parent 7353de035f
commit 4a5307842c

View File

@ -65,21 +65,26 @@ export const addUserAsync = createAsyncThunk<
// apiのConfigurationを取得する
const { getState } = thunkApi;
const state = getState() as RootState;
const { configuration } = state.auth;
const { configuration, accessToken } = state.auth;
const config = new Configuration(configuration);
const usersApi = new UsersApi(config);
try {
await usersApi.signup({
name,
email,
role,
authorId,
typistGroupId,
autoRenew,
licenseAlert,
notification,
});
await usersApi.signup(
{
name,
email,
role,
authorId,
typistGroupId,
autoRenew,
licenseAlert,
notification,
},
{
headers: { authorization: `Bearer ${accessToken}` },
}
);
thunkApi.dispatch(
openSnackbar({
level: "info",