From 2a86aa741b5fe1cc7e8c5f69dc2fe6bd8863d47e Mon Sep 17 00:00:00 2001 From: Alexey Vasiliev Date: Sat, 26 Oct 2024 19:38:53 +0300 Subject: [PATCH] improve url performance to select from fields --- src/common/components/configurationForm/index.jsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/common/components/configurationForm/index.jsx b/src/common/components/configurationForm/index.jsx index eb1ac27..79072d4 100644 --- a/src/common/components/configurationForm/index.jsx +++ b/src/common/components/configurationForm/index.jsx @@ -99,13 +99,15 @@ const hdTypeOptions = () => [ } ] -const filterFormParams = (params = {}) => - Object.keys(params).reduce((arr, key) => { - if (FORM_FIELDS.includes(key)) { +const filterFormParams = (params = {}) => { + const paramKeys = Object.keys(params) + return FORM_FIELDS.reduce((arr, key) => { + if (paramKeys.includes(key)) { arr[key] = params[key] } return arr }, {}) +} const ConfigurationForm = () => { const dispatch = useDispatch()