@@ -27,6 +27,7 @@ import {
27
27
requestingUser ,
28
28
SortCol ,
29
29
sortWith ,
30
+ variable ,
30
31
} from '~/core/database/query' ;
31
32
import { Privileges } from '../authorization' ;
32
33
import { locationSorters } from '../location/location.repository' ;
@@ -86,6 +87,13 @@ export class ProjectRepository extends CommonRepository {
86
87
relation ( 'out' , '' , 'rootDirectory' , ACTIVE ) ,
87
88
node ( 'rootDirectory' , 'Directory' ) ,
88
89
] )
90
+ . optionalMatch ( [
91
+ node ( 'node' ) ,
92
+ relation ( 'out' , '' , 'partnership' , ACTIVE ) ,
93
+ node ( 'primaryPartnership' , 'Partnership' ) ,
94
+ relation ( 'out' , '' , 'primary' , ACTIVE ) ,
95
+ node ( '' , 'Property' , { value : variable ( 'true' ) } ) ,
96
+ ] )
89
97
. optionalMatch ( [
90
98
node ( 'node' ) ,
91
99
relation ( 'out' , '' , 'primaryLocation' , ACTIVE ) ,
@@ -125,6 +133,7 @@ export class ProjectRepository extends CommonRepository {
125
133
type : 'node.type' ,
126
134
pinned : 'exists((:User { id: $requestingUser })-[:pinned]->(node))' ,
127
135
rootDirectory : 'rootDirectory { .id }' ,
136
+ primaryPartnership : 'primaryPartnership { .id }' ,
128
137
primaryLocation : 'primaryLocation { .id }' ,
129
138
marketingLocation : 'marketingLocation { .id }' ,
130
139
fieldRegion : 'fieldRegion { .id }' ,
0 commit comments