tods-competition-factory 1.2.8 → 1.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -21165,6 +21165,7 @@ var __spreadValues$a = (a, b) => {
21165
21165
  return a;
21166
21166
  };
21167
21167
  function setMatchUpFormat(params) {
21168
+ let structureIds = params.structureIds;
21168
21169
  const {
21169
21170
  tournamentRecord,
21170
21171
  drawDefinition,
@@ -21202,6 +21203,19 @@ function setMatchUpFormat(params) {
21202
21203
  drawDefinition,
21203
21204
  matchUp
21204
21205
  });
21206
+ } else if (Array.isArray(structureIds)) {
21207
+ if ((event == null ? void 0 : event.eventType) === TEAM$1)
21208
+ return { error: INVALID_EVENT_TYPE };
21209
+ for (const structureId2 of structureIds) {
21210
+ const result = findStructure({ drawDefinition, structureId: structureId2 });
21211
+ if (result.error)
21212
+ return result;
21213
+ if (!result.structure) {
21214
+ return { error: STRUCTURE_NOT_FOUND };
21215
+ } else {
21216
+ result.structure.matchUpFormat = matchUpFormat;
21217
+ }
21218
+ }
21205
21219
  } else if (structureId) {
21206
21220
  if ((event == null ? void 0 : event.eventType) === TEAM$1)
21207
21221
  return { error: INVALID_EVENT_TYPE };
@@ -21216,7 +21230,7 @@ function setMatchUpFormat(params) {
21216
21230
  } else if (drawDefinition) {
21217
21231
  drawDefinition.matchUpFormat = matchUpFormat;
21218
21232
  }
21219
- const structureIds = structureId ? [structureId] : void 0;
21233
+ structureIds = structureIds || (structureId ? [structureId] : void 0);
21220
21234
  modifyDrawNotice({ drawDefinition, structureIds });
21221
21235
  return __spreadValues$a({}, SUCCESS);
21222
21236
  }