@@ -336,7 +336,7 @@ export class EngagementRepository extends CommonRepository {
336
336
337
337
async list ( input : EngagementListInput , session : Session , changeset ?: ID ) {
338
338
const label =
339
- simpleSwitch ( input . filter . type , {
339
+ simpleSwitch ( input . filter ? .type , {
340
340
language : 'LanguageEngagement' ,
341
341
internship : 'InternshipEngagement' ,
342
342
} ) ?? 'Engagement' ;
@@ -346,14 +346,14 @@ export class EngagementRepository extends CommonRepository {
346
346
. subQuery ( ( sub ) =>
347
347
sub
348
348
. match ( [
349
- node ( 'project' , 'Project' , pickBy ( { id : input . filter . projectId } ) ) ,
349
+ node ( 'project' , 'Project' , pickBy ( { id : input . filter ? .projectId } ) ) ,
350
350
relation ( 'out' , '' , 'engagement' , ACTIVE ) ,
351
351
node ( 'node' , label ) ,
352
352
] )
353
353
. apply ( whereNotDeletedInChangeset ( changeset ) )
354
354
. return ( [ 'node' , 'project' ] )
355
355
. apply ( ( q ) =>
356
- changeset && input . filter . projectId
356
+ changeset && input . filter ? .projectId
357
357
? q
358
358
. union ( )
359
359
. match ( [
@@ -369,7 +369,7 @@ export class EngagementRepository extends CommonRepository {
369
369
)
370
370
. match ( requestingUser ( session ) )
371
371
. apply (
372
- filter . builder ( input . filter , {
372
+ filter . builder ( input . filter ?? { } , {
373
373
type : filter . skip ,
374
374
projectId : filter . skip ,
375
375
partnerId : filter . pathExists ( ( id ) => [
0 commit comments