visgraph: improve splitId(node_id,'id') : return always integer

node_id value examples:
* 'accompanying_period_124' --> 124
* '124' --> 124
* 124 --> 124
This commit is contained in:
2021-11-05 13:40:06 +01:00
parent 0f8ca77105
commit 9494bdee2a
3 changed files with 13 additions and 4 deletions

View File

@@ -88,13 +88,14 @@ const store = createStore({
*/
getFoldedPersons: (state) => (array) => {
let folded = []
console.log('array', array.map(item => item.person.id))
array.forEach(item => {
let id = (typeof item.person._id !== 'undefined') ? item.person._id : item.person.id
let id = splitId(item.person.id, 'id')
console.log(id)
if (state.personLoadedIds.includes(id)) {
folded.push(state.persons.filter(person => person._id === id)[0])
}
})
//console.log('array', array.map(r => r.person.id))
console.log('get FoldedPersons', folded.map(f => f.id))
return folded
},