From bb9d1468cc8f7bdf80f17fc2ed54ada9c085b718 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 19 May 2022 16:54:24 +0100 Subject: [PATCH] refactor const edits --- app/src/frontend/building/data-container.tsx | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/app/src/frontend/building/data-container.tsx b/app/src/frontend/building/data-container.tsx index b3726806..6315cb91 100644 --- a/app/src/frontend/building/data-container.tsx +++ b/app/src/frontend/building/data-container.tsx @@ -246,16 +246,10 @@ const withCopyEdit: (wc: React.ComponentType) => DataContaine } catch(err) { this.setState({error: err}); } - - if (slug == 'current_landuse_group'){ - const edits = { - ['current_landuse_verified']: true - }; - } else { - const edits = { - [slug]: value - }; - } + + const edits = (slug == 'current_landuse_group') ? + {['current_landuse_verified']: true} : + {[slug]: value} this.doSubmit(edits); console.log(slug + " verify button clicked")