mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-08 00:39:50 +03:00
fix admin checkbox
This commit is contained in:
@@ -13,7 +13,7 @@ import SaveIcon from '@material-ui/icons/Save';
|
|||||||
import PersonAddIcon from '@material-ui/icons/PersonAdd';
|
import PersonAddIcon from '@material-ui/icons/PersonAdd';
|
||||||
|
|
||||||
import { withAuthenticatedContext, AuthenticatedContextProps } from '../authentication';
|
import { withAuthenticatedContext, AuthenticatedContextProps } from '../authentication';
|
||||||
import { RestFormProps, FormActions, FormButton } from '../components';
|
import { RestFormProps, FormActions, FormButton, extractEventValue } from '../components';
|
||||||
|
|
||||||
import UserForm from './UserForm';
|
import UserForm from './UserForm';
|
||||||
import { SecuritySettings, User } from './types';
|
import { SecuritySettings, User } from './types';
|
||||||
@@ -93,13 +93,9 @@ class ManageUsersForm extends React.Component<ManageUsersFormProps, ManageUsersF
|
|||||||
};
|
};
|
||||||
|
|
||||||
handleUserValueChange = (name: keyof User) => (event: React.ChangeEvent<HTMLInputElement>) => {
|
handleUserValueChange = (name: keyof User) => (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
this.setState({ user: { ...this.state.user!, [name]: event.target.value } });
|
this.setState({ user: { ...this.state.user!, [name]: extractEventValue(event) } });
|
||||||
};
|
};
|
||||||
|
|
||||||
handleUserCheckboxChange = (name: keyof User) => (event: React.ChangeEvent<HTMLInputElement>) => {
|
|
||||||
this.setState({ user: { ...this.state.user!, [name]: event.target.checked } });
|
|
||||||
}
|
|
||||||
|
|
||||||
onSubmit = () => {
|
onSubmit = () => {
|
||||||
this.props.saveData();
|
this.props.saveData();
|
||||||
this.props.authenticatedContext.refresh();
|
this.props.authenticatedContext.refresh();
|
||||||
|
|||||||
Reference in New Issue
Block a user