Skip to content

Commit 65c01fd

Browse files
committed
Allow sorting projects by "engagements" (count)
1 parent a82534f commit 65c01fd

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/components/project/project.repository.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,14 @@ export class ProjectRepository extends CommonRepository {
286286
query
287287
.apply(matchProjectSens('node'))
288288
.return<{ sortValue: string }>('sensitivity as sortValue'),
289+
engagements: (query) =>
290+
query
291+
.match([
292+
node('node'),
293+
relation('out', '', 'engagement'),
294+
node('engagement', 'LanguageEngagement'),
295+
])
296+
.return<{ sortValue: number }>('count(engagement) as sortValue'),
289297
}),
290298
)
291299
.apply(paginate(input, this.hydrate(session.userId)))

0 commit comments

Comments
 (0)