@@ -64,6 +64,7 @@ export class PartnerRepository extends DtoRepository<
64
64
input . languageOfWiderCommunicationId ,
65
65
] ,
66
66
fieldRegions : [ 'FieldRegion' , input . fieldRegions ] ,
67
+ countries : [ 'Location' , input . countries ] ,
67
68
} ) ,
68
69
)
69
70
. return < { id : ID } > ( 'node.id as id' )
@@ -114,6 +115,15 @@ export class PartnerRepository extends DtoRepository<
114
115
] )
115
116
. return ( collect ( 'fieldRegions.id' ) . as ( 'fieldRegionsIds' ) ) ,
116
117
)
118
+ . subQuery ( 'node' , ( sub ) =>
119
+ sub
120
+ . match ( [
121
+ node ( 'node' ) ,
122
+ relation ( 'out' , '' , 'countries' ) ,
123
+ node ( 'countries' , 'Location' ) ,
124
+ ] )
125
+ . return ( collect ( 'countries.id' ) . as ( 'countriesIds' ) ) ,
126
+ )
117
127
. apply ( matchProps ( ) )
118
128
. optionalMatch ( [
119
129
node ( 'node' ) ,
@@ -137,6 +147,7 @@ export class PartnerRepository extends DtoRepository<
137
147
pointOfContact : 'pointOfContact.id' ,
138
148
languageOfWiderCommunication : 'languageOfWiderCommunication.id' ,
139
149
fieldRegions : 'fieldRegionsIds' ,
150
+ countries : 'countriesIds' ,
140
151
scope : 'scopedRoles' ,
141
152
pinned : 'exists((:User { id: $requestingUser })-[:pinned]->(node))' ,
142
153
} ) . as ( 'dto' ) ,
0 commit comments