mirror of
https://github.com/rowyio/rowy.git
synced 2025-12-28 16:06:41 +01:00
fixed checkbox
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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 });
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user