fixed checkbox

This commit is contained in:
shams mosowi
2019-09-20 11:52:54 +10:00
parent 7c86a2b2ee
commit e7bf552885
2 changed files with 2 additions and 1 deletions

View File

@@ -5,6 +5,7 @@ const CheckBox = (props: any) => {
const { value, row, onSubmit } = props;
return (
<Checkbox
name={`checkBox-controlled-${row.id}`}
checked={value}
onChange={e => {
onSubmit(row.ref, !value);

View File

@@ -51,7 +51,7 @@ const onSubmit = (fieldName: string) => (
ref: firebase.firestore.DocumentReference,
value: any
) => {
if (!!value) {
if (value !== null || value !== undefined) {
ref.update({ [fieldName]: value });
}
};