From 2adfe7ce1da23e2cfade6baace61f79defbab20c Mon Sep 17 00:00:00 2001 From: tranquanghuy0801 Date: Fri, 30 Apr 2021 10:40:16 +1000 Subject: [PATCH] fix: edit planter - clear planter organization --- src/api/planters.js | 3 +++ src/components/EditPlanter.js | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/api/planters.js b/src/api/planters.js index 34bbe47e5..9ab22eb41 100644 --- a/src/api/planters.js +++ b/src/api/planters.js @@ -102,6 +102,9 @@ export default { }, updatePlanter(planterUpdate) { + if (planterUpdate.organizationId === 'null') { + planterUpdate = { ...planterUpdate, organizationId: null }; + } const { id } = planterUpdate; const planterQuery = `${ process.env.REACT_APP_API_ROOT diff --git a/src/components/EditPlanter.js b/src/components/EditPlanter.js index 828ed1ad4..5ba37601f 100644 --- a/src/components/EditPlanter.js +++ b/src/components/EditPlanter.js @@ -175,6 +175,9 @@ const EditPlanter = (props) => { handleChange('organizationId', e.target.value); }} > + + No organization + {[...props.organizationState.organizationList].map((org) => ( {org.name}