Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Commit

Permalink
fix(files): Properly linking to participants.
Browse files Browse the repository at this point in the history
- Fixes bug viewing participants for a file.

Closes #605
  • Loading branch information
Matthew Schranz committed Mar 16, 2015
1 parent aa291d2 commit 00c9158
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions app/scripts/search/search.files.table.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,13 @@ module ngApp.search.models {
}
},
sref: function (field, row, scope, $filter) {
var participant = field.val;
if (field.val.length > 1) {
var filters = $filter("makeFilter")([{name: "participant.participant_id", value: field.val}]);
var participants = field.val;
if (participants.length > 1) {
var file_id = _.find(row, (item) => {
return item.id === "file_id"
}).val;

var filters = $filter("makeFilter")([{name: "files.file_id", value: file_id}]);
return {
state: "/search/p",
filters: {
Expand All @@ -154,11 +158,11 @@ module ngApp.search.models {
};
}

if (participant) {
if (participants) {
return {
state: "/participants/",
filters: {
participantId: participant[0].participant_id
participantId: participants[0].participant_id
}
};
}
Expand Down

0 comments on commit 00c9158

Please sign in to comment.