Skip to content

Commit

Permalink
Update auth type and credentials in CreateDataSourceForm
Browse files Browse the repository at this point in the history
Signed-off-by: Su <[email protected]>
  • Loading branch information
zhongnansu committed May 18, 2023
1 parent 2df5ad5 commit 8451673
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,17 @@ export class CreateDataSourceForm extends React.Component<
};

onChangeAuthType = (e: React.ChangeEvent<HTMLSelectElement>) => {
this.setState({ auth: { ...this.state.auth, type: e.target.value as AuthType } });
const authType = e.target.value as AuthType;
this.setState({
auth: {
...this.state.auth,
type: authType,
credentials: {
...this.state.auth.credentials,
service: authType === AuthType.SigV4 ? SigV4ServiceName.OpenSearch : undefined,
},
},
});
};

onChangeSigV4ServiceName = (e: React.ChangeEvent<HTMLSelectElement>) => {
Expand Down

0 comments on commit 8451673

Please sign in to comment.