From a320d6565282139ac9eb74e19c39f08fda5e9eab Mon Sep 17 00:00:00 2001 From: Brian Cao Date: Fri, 21 Oct 2022 22:19:51 -0700 Subject: [PATCH] default column/filters --- components/forms/EventDataForm.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/components/forms/EventDataForm.js b/components/forms/EventDataForm.js index 1bd27a12..db8e7fbb 100644 --- a/components/forms/EventDataForm.js +++ b/components/forms/EventDataForm.js @@ -77,8 +77,8 @@ export const dateOptions = [ export default function EventDataForm({ websiteId, onClose, className }) { const { post } = useApi(); const [message, setMessage] = useState(); - const [columns, setColumns] = useState(); - const [filters, setFilters] = useState(); + const [columns, setColumns] = useState({}); + const [filters, setFilters] = useState({}); const [data, setData] = useState([]); const [dateRange, setDateRange] = useDateRange('report'); const { startDate, endDate, value } = dateRange; @@ -99,11 +99,11 @@ export default function EventDataForm({ websiteId, onClose, className }) { }; const handleRemoveTag = (value, list, setState) => { - const next = { ...list }; + const newList = { ...list }; - delete next[`${value}`]; + delete newList[`${value}`]; - setState(next); + setState(newList); }; const handleSubmit = async () => {