Skip to content

Commit

Permalink
fix: use $assignee variable instead of $operator in assignee facet
Browse files Browse the repository at this point in the history
Also change leadersboard key to operators for operator leadersboards
  • Loading branch information
BenMaruchu committed Aug 22, 2019
1 parent 5770fb6 commit 2705825
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/base/facets.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ export const SERVICE_STATUS_BREAKDOWN_FACET = {
* @since 0.1.0
*/
export const OPERATOR_LEADERSBOARD_FACET = {
leadersboard: [
operators: [
{
$group: {
_id: '$operator._id',
Expand All @@ -405,6 +405,7 @@ export const OPERATOR_LEADERSBOARD_FACET = {
name: { $first: '$operator.name' },
email: { $first: '$operator.email' },
phone: { $first: '$operator.phone' },
relation: { $first: '$operator.relation' },
},
},
{
Expand All @@ -426,13 +427,14 @@ export const ASSIGNEE_LEADERSBOARD_FACET = {
assignees: [
{
$group: {
_id: '$$assignee._id',
_id: '$assignee._id',
pending: { $sum: '$pending' },
resolved: { $sum: '$resolved' },
count: { $sum: 1 },
name: { $first: '$operator.name' },
email: { $first: '$operator.email' },
phone: { $first: '$operator.phone' },
name: { $first: '$assignee.name' },
email: { $first: '$assignee.email' },
phone: { $first: '$assignee.phone' },
relation: { $first: '$assignee.relation' },
},
},
{
Expand Down

0 comments on commit 2705825

Please sign in to comment.