|
1 | 1 | import { Injectable } from '@nestjs/common';
|
| 2 | +import { mapValues } from '@seedcompany/common'; |
2 | 3 | import { inArray, node, not, type Query, relation } from 'cypher-query-builder';
|
3 | 4 | import { DateTime } from 'luxon';
|
4 | 5 | import {
|
@@ -391,14 +392,20 @@ export const projectSorters = defineSorters(IProject, {
|
391 | 392 | query
|
392 | 393 | .apply(matchProjectSens('node', 'sortValue'))
|
393 | 394 | .return<SortCol>('sortValue'),
|
394 |
| - engagements: (query) => |
395 |
| - query |
396 |
| - .match([ |
397 |
| - node('node'), |
398 |
| - relation('out', '', 'engagement'), |
399 |
| - node('engagement', 'LanguageEngagement'), |
400 |
| - ]) |
401 |
| - .return<SortCol>('count(engagement) as sortValue'), |
| 395 | + ...mapValues.fromList( |
| 396 | + [ |
| 397 | + 'engagements', // probably "deprecated" |
| 398 | + 'engagements.total', |
| 399 | + ], |
| 400 | + () => (query: Query) => |
| 401 | + query |
| 402 | + .match([ |
| 403 | + node('node'), |
| 404 | + relation('out', '', 'engagement'), |
| 405 | + node('engagement', 'LanguageEngagement'), |
| 406 | + ]) |
| 407 | + .return<SortCol>('count(engagement) as sortValue'), |
| 408 | + ).asRecord, |
402 | 409 | // eslint-disable-next-line @typescript-eslint/naming-convention
|
403 | 410 | 'primaryLocation.*': (query, input) => {
|
404 | 411 | const getPath = (anon = false) => [
|
|
0 commit comments