Commit 02fc055d authored by Curtis Adam's avatar Curtis Adam

Fix author filter not sorting names for the transcript view

parent be0f2ca4
......@@ -18,21 +18,16 @@ Template.filterItemFilterAuthors.helpers({
return Filter.getFilterQuery().owner !== undefined;
},
getAuthors: function () {
let query = {};
if (Route.isTranscriptBonus()) {
let bonusTranscripts = TranscriptBonus.find({cardset_id: Router.current().params._id}).fetch();
let userFilter = [];
for (let i = 0; i < bonusTranscripts.length; i++) {
userFilter.push(bonusTranscripts[i].user_id);
}
return Meteor.users.find({_id: {$in: userFilter}},
{
fields: {
'profile.birthname': 1
}
});
} else {
return Meteor.users.find({}, {fields: {_id: 1, profile: 1}, sort: {"profile.birthname": 1}}).fetch();
query._id = {$in: userFilter};
}
return Meteor.users.find(query, {fields: {_id: 1, profile: 1}, sort: {"profile.birthname": 1}}).fetch();
},
filterAuthors: function (id) {
if (Route.isTranscriptBonus()) {
......
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