Commit 23a8e128 authored by PDuarte's avatar PDuarte

avalibilit muti locations fix

parent 718a02d9
...@@ -116,9 +116,37 @@ const PlanAvaliability = ({dataElement, handleElmChange}) => { ...@@ -116,9 +116,37 @@ const PlanAvaliability = ({dataElement, handleElmChange}) => {
} }
} }
}) })
let coValues
if (actionValue === 'permit') {
coValues = denytGeo.map(elm => {
return {
id: elm.value,
name: elm.label,
pivot: {
idgeolocation: elm.value,
idavailability: dataElement.id,
action: 'deny'
}
}
})
} else {
coValues = permitGeo.map(elm => {
return {
id: elm.value,
name: elm.label,
pivot: {
idgeolocation: elm.value,
idavailability: dataElement.id,
action: 'permit'
}
}
})
}
const geoparts = newValue.concat(coValues)
const newData = { const newData = {
...dataElement, ...dataElement,
geolocations: newValue geolocations: geoparts
} }
handleElmChange(newData) handleElmChange(newData)
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment