From e7bf552885c0d31157c7e91b7f4854b1af5bf727 Mon Sep 17 00:00:00 2001 From: shams mosowi Date: Fri, 20 Sep 2019 11:52:54 +1000 Subject: [PATCH] fixed checkbox --- src/components/Fields/CheckBox.tsx | 1 + src/components/Table/index.tsx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/Fields/CheckBox.tsx b/src/components/Fields/CheckBox.tsx index 5e0716c7..85f8cdba 100644 --- a/src/components/Fields/CheckBox.tsx +++ b/src/components/Fields/CheckBox.tsx @@ -5,6 +5,7 @@ const CheckBox = (props: any) => { const { value, row, onSubmit } = props; return ( { onSubmit(row.ref, !value); diff --git a/src/components/Table/index.tsx b/src/components/Table/index.tsx index c78e25c7..98b6bd97 100644 --- a/src/components/Table/index.tsx +++ b/src/components/Table/index.tsx @@ -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 }); } };