Skip to content

Commit

Permalink
OpenConceptLab/ocl_issues#1458 | fixing on save handler
Browse files Browse the repository at this point in the history
  • Loading branch information
snyaggarwal committed Mar 9, 2023
1 parent 3edcc2f commit ef8d142
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
1 change: 1 addition & 0 deletions src/components/concepts/ConceptHome.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ class ConceptHome extends React.Component {
onUpdateMappingsSorting = mappings => {
Promise.all(map(mappings, mapping => APIService.new().overrideURL(mapping.url).put({id: mapping.id, sort_weight: mapping._sort_weight, comment: 'Updated Sort Weight'}))).then(() => {
alertifyjs.success('Mappings successfully updated.')
this.getMappings(true)
})
}

Expand Down
11 changes: 0 additions & 11 deletions src/components/concepts/HomeMappings.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,20 +134,9 @@ const HomeMappings = ({ source, concept, isLoadingMappings, sourceVersion, paren

const onSortSave = () => {
onUpdateMappingsSorting(updatedMappings)
const newMappings = {...orderedMappings}
forEach(newMappings, data => {
forEach([...data.direct, ...data.indirect, ...data.self], mapping => {
const _mapping = find(updatedMappings, {version_url: mapping.version_url})
mapping.sort_weight = _mapping?._sort_weight || mapping.sort_weight
mapping._sort_weight = undefined
mapping._initial_assigned_sort_weight = undefined
})
})
setMappings(newMappings)
setUpdatedMappings([])
}


return (
<React.Fragment>
<Accordion expanded style={{borderRadius: 'unset'}}>
Expand Down

0 comments on commit ef8d142

Please sign in to comment.