Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fixed edit planter (clear planter organization) #75

Merged
merged 1 commit into from
Apr 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/api/planters.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions src/components/EditPlanter.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ const EditPlanter = (props) => {
handleChange('organizationId', e.target.value);
}}
>
<MenuItem key={'null'} value={'null'}>
No organization
</MenuItem>
{[...props.organizationState.organizationList].map((org) => (
<MenuItem key={org.id} value={org.id}>
{org.name}
Expand Down