🐛 Fixing office roles not changing

This commit is contained in:
Maxime Lalo 2023-07-17 17:57:19 +02:00
parent ef2de855ca
commit a5d74176d5
2 changed files with 7 additions and 1 deletions

View File

@ -28,7 +28,7 @@ export default class OfficeRoles extends BaseAdmin {
} }
} }
public async get(q: IGetRolesParams): Promise<OfficeRole[]> { public async get(q?: IGetRolesParams): Promise<OfficeRole[]> {
const url = new URL(this.baseURl); const url = new URL(this.baseURl);
if (q) { if (q) {
const query = { q }; const query = { q };

View File

@ -123,6 +123,12 @@ export default class SelectField extends React.Component<IProps, IState> {
errors: this.props.errors ?? null, errors: this.props.errors ?? null,
}); });
} }
if (this.props.selectedOption !== prevProps.selectedOption) {
this.setState({
selectedOption: this.props.selectedOption ?? null,
});
}
} }
static getDerivedStateFromProps(props: IProps, state: IState) { static getDerivedStateFromProps(props: IProps, state: IState) {