|
|
|
|
@ -58,7 +58,9 @@ class DataStore: ObservableObject { |
|
|
|
|
|
|
|
|
|
init() { |
|
|
|
|
let store = Store.main |
|
|
|
|
store.synchronizationApiURL = "https://xlr.alwaysdata.net/api/" |
|
|
|
|
store.synchronizationApiURL = "https://xlr.alwaysdata.net/roads/" |
|
|
|
|
store.logsFailedAPICalls() |
|
|
|
|
|
|
|
|
|
var synchronized : Bool = true |
|
|
|
|
|
|
|
|
|
_ = Guard.main // init |
|
|
|
|
@ -206,16 +208,9 @@ class DataStore: ObservableObject { |
|
|
|
|
|
|
|
|
|
for groupStage in tournament.groupStages() { |
|
|
|
|
_ = try await service.post(groupStage) |
|
|
|
|
// for match in groupStage._matches() { |
|
|
|
|
// try await self._insertMatch(match: match, service: service) |
|
|
|
|
// } |
|
|
|
|
} |
|
|
|
|
for round in tournament.rounds() { |
|
|
|
|
try await self._insertRoundAndChildren(round: round, service: service) |
|
|
|
|
// _ = try await service.post(round) |
|
|
|
|
// for match in round._matches() { |
|
|
|
|
// try await self._insertMatch(match: match, service: service) |
|
|
|
|
// } |
|
|
|
|
} |
|
|
|
|
for teamRegistration in tournament.unsortedTeams() { |
|
|
|
|
_ = try await service.post(teamRegistration) |
|
|
|
|
@ -224,13 +219,11 @@ class DataStore: ObservableObject { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
for groupStage in tournament.groupStages() { |
|
|
|
|
// _ = try await service.post(groupStage) |
|
|
|
|
for match in groupStage._matches() { |
|
|
|
|
try await self._insertMatch(match: match, service: service) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
for round in tournament.allRounds() { |
|
|
|
|
// _ = try await service.post(round) |
|
|
|
|
for match in round._matches() { |
|
|
|
|
try await self._insertMatch(match: match, service: service) |
|
|
|
|
} |
|
|
|
|
|