forked from platypush/platypush
Fixed grouping for entityGroups.id
.
Unlike the other entity groupings, which are 4-layered (`grouping -> group -> entity_id -> entity`), the grouping by ID only needs 3 layers (`grouping -> entity_id -> entity`).
This commit is contained in:
parent
cc2ec1db7f
commit
9922305ac5
1 changed files with 7 additions and 3 deletions
|
@ -187,9 +187,13 @@ export default {
|
||||||
if (entity[attr] == null)
|
if (entity[attr] == null)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if (attr == 'id')
|
||||||
|
this.entityGroups[attr][entity[attr]] = entity
|
||||||
|
else {
|
||||||
if (!this.entityGroups[attr][entity[attr]])
|
if (!this.entityGroups[attr][entity[attr]])
|
||||||
this.entityGroups[attr][entity[attr]] = {}
|
this.entityGroups[attr][entity[attr]] = {}
|
||||||
this.entityGroups[attr][entity[attr]][entity.id] = entity
|
this.entityGroups[attr][entity[attr]][entity.id] = entity
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue