diff --git a/documentation/docs/concepts/matchup-filtering.mdx b/documentation/docs/concepts/matchup-filtering.mdx index 588932ca7a..3840b51736 100644 --- a/documentation/docs/concepts/matchup-filtering.mdx +++ b/documentation/docs/concepts/matchup-filtering.mdx @@ -10,9 +10,9 @@ The underlying `filterMatchUps` method is also exposed for direct use via the `m ```js const matchUpFilters = { matchUpFormat: 'SET3-S:6/TB7-F:TB10', + isCollectionMatchUp: false, excludeMatchUpStatuses: [], hasParticipantsCount: 2, - isCollectionMatchUp: [], hasWinningSide: true, isMatchUpTie: false, matchUpStatuses: [], diff --git a/src/query/drawDefinition/matchUpActions/matchUpActions.ts b/src/query/drawDefinition/matchUpActions/matchUpActions.ts index 660fcbc9fd..7f393bdc0b 100644 --- a/src/query/drawDefinition/matchUpActions/matchUpActions.ts +++ b/src/query/drawDefinition/matchUpActions/matchUpActions.ts @@ -170,7 +170,7 @@ export function matchUpActions(params?: MatchUpActionsArgs): ResultType & { if (!structureId) return { validActions }; const isAdHocMatchUp = isAdHoc({ structure }); - const isCollectionMatchUp = matchUp.collectionId; + const isCollectionMatchUp = Boolean(matchUp.collectionId); if (isAdHocMatchUp && !isCollectionMatchUp) { const adHocValidActions = adHocMatchUpActions({ diff --git a/src/query/structure/getStructureDrawPositionProfiles.ts b/src/query/structure/getStructureDrawPositionProfiles.ts index ec412ef2e9..ffb2bbe10e 100644 --- a/src/query/structure/getStructureDrawPositionProfiles.ts +++ b/src/query/structure/getStructureDrawPositionProfiles.ts @@ -26,9 +26,9 @@ export function getStructureDrawPositionProfiles(params: GetStructureDrawPositio const { drawDefinition, findContainer, structureId, event } = params; let structure = params.structure; - const matchUpFilters = { isCollectionMatchUp: false }; const { containedStructures } = getContainedStructures({ drawDefinition }); const containedStructureIds = structureId ? containedStructures[structureId] || [] : []; + const matchUpFilters = { isCollectionMatchUp: false }; if (!structure) { const result = findStructure({ drawDefinition, structureId }); diff --git a/src/query/structure/getStructureMatchUps.ts b/src/query/structure/getStructureMatchUps.ts index 13ad62d062..8922752685 100644 --- a/src/query/structure/getStructureMatchUps.ts +++ b/src/query/structure/getStructureMatchUps.ts @@ -150,7 +150,7 @@ export function getStructureMatchUps({ if (matchUp.matchUpType === TEAM) includesTeamMatchUps = true; - const isCollectionMatchUp = matchUp.collectionId; + const isCollectionMatchUp = Boolean(matchUp.collectionId); const collectionSidesAssigned = isCollectionMatchUp && matchUp.sides?.every((side) => side.participantId); const drawPositionsFilled = !isCollectionMatchUp && matchUp.drawPositions?.filter(Boolean).length === 2;