diff --git a/src/domain-services/flows/flow-search-service.ts b/src/domain-services/flows/flow-search-service.ts index bb3d19f5..d78a5f42 100644 --- a/src/domain-services/flows/flow-search-service.ts +++ b/src/domain-services/flows/flow-search-service.ts @@ -366,8 +366,14 @@ export class FlowSearchService { databaseConnection: Knex, filters: SearchFlowsArgs ): Promise { - const { limit, nextPageCursor, prevPageCursor, sortField, sortOrder } = - filters; + const { + limit, + nextPageCursor, + prevPageCursor, + sortField, + sortOrder, + includeChildrenOfParkedFlows: shouldIncludeChildrenOfParkedFlows, + } = filters; const orderBy: FlowOrderBy = this.buildOrderBy(sortField, sortOrder); @@ -499,7 +505,8 @@ export class FlowSearchService { let parkedParentSource: FlowParkedParentSource | null = null; const shouldLookAfterParentSource = - flow.activeStatus && flowLink.length > 0; + flowLink.length > 0 && shouldIncludeChildrenOfParkedFlows; + if (shouldLookAfterParentSource) { parkedParentSource = await this.getParketParents( flow, @@ -848,6 +855,7 @@ export class FlowSearchService { const mappedParkedParentOrganizations: FlowParkedParentSource = { organization: [], orgName: [], + abbreviation: [], }; for (const parkedParentOrganization of parkedParentOrganizations) { @@ -857,6 +865,9 @@ export class FlowSearchService { mappedParkedParentOrganizations.orgName.push( parkedParentOrganization.name ); + mappedParkedParentOrganizations.abbreviation.push( + parkedParentOrganization.abbreviation ?? '' + ); } return mappedParkedParentOrganizations; diff --git a/src/domain-services/flows/graphql/types.ts b/src/domain-services/flows/graphql/types.ts index 0a5d6ddd..075bce70 100644 --- a/src/domain-services/flows/graphql/types.ts +++ b/src/domain-services/flows/graphql/types.ts @@ -39,6 +39,9 @@ export class FlowParkedParentSource { @Field(() => [String], { nullable: false }) orgName: string[]; + + @Field(() => [String], { nullable: false }) + abbreviation: string[]; } @ObjectType()