diff --git a/src/domain-services/flows/flow-search-service.ts b/src/domain-services/flows/flow-search-service.ts index bb3d19f5..231d3547 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,