I have these 3 methods:
getGroupId(){
return UserResolutionGroups.findOne({active: true})._id;
}
resolutionGroups(){
return UserResolutionGroups.find({}, {sort: {createdOn: -1}}).fetch();
}
resolutions(){
return UserResolutions.find({groupId: this.getGroupId()}, {sort: {complete: 1, createdOn: -1}}).fetch();
}
I know getGroupId works because the resolutionGroups() function returns all the groups and displays it on the UI.
However the resolutions function will only work with:
return UserResolutions.find({}, {sort: {complete: 1, createdOn: -1}}).fetch();
and not with:
return UserResolutions.find({groupId: this.getGroupId()}, {sort: {complete: 1, createdOn: -1}}).fetch();
Could someone please help with this.
I have tried moving the function order around incase it was to do with the function needing to be higher up in the order but I can unsure of this as the resolutionGroups() function is lower in order and works fine.
Thanks