diff --git a/PadelClub/Data/DataStore.swift b/PadelClub/Data/DataStore.swift index a101ad4..b316457 100644 --- a/PadelClub/Data/DataStore.swift +++ b/PadelClub/Data/DataStore.swift @@ -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) } diff --git a/PadelClubTests/ServerDataTests.swift b/PadelClubTests/ServerDataTests.swift index eb8c438..b6a16dc 100644 --- a/PadelClubTests/ServerDataTests.swift +++ b/PadelClubTests/ServerDataTests.swift @@ -15,7 +15,7 @@ final class ServerDataTests: XCTestCase { let password: String = "MyPass1234--" override func setUpWithError() throws { - Store.main.synchronizationApiURL = "http://127.0.0.1:8000/api/" + Store.main.synchronizationApiURL = "http://127.0.0.1:8000/roads/" Task { do { try await self.login() diff --git a/PadelClubTests/TokenExemptionTests.swift b/PadelClubTests/TokenExemptionTests.swift index 1d87e7a..8423ab7 100644 --- a/PadelClubTests/TokenExemptionTests.swift +++ b/PadelClubTests/TokenExemptionTests.swift @@ -16,7 +16,7 @@ final class TokenExemptionTests: XCTestCase { let password: String = "MyPass1234--" override func setUpWithError() throws { - Store.main.synchronizationApiURL = "http://127.0.0.1:8000/api/" + Store.main.synchronizationApiURL = "http://127.0.0.1:8000/roads/" Store.main.disconnect() } diff --git a/PadelClubTests/UserDataTests.swift b/PadelClubTests/UserDataTests.swift index b9fcdf4..21ef9d0 100644 --- a/PadelClubTests/UserDataTests.swift +++ b/PadelClubTests/UserDataTests.swift @@ -15,7 +15,7 @@ final class UserDataTests: XCTestCase { let password: String = "MyPass1234--" override func setUpWithError() throws { - Store.main.synchronizationApiURL = "http://127.0.0.1:8000/api/" + Store.main.synchronizationApiURL = "http://127.0.0.1:8000/roads/" } override func tearDownWithError() throws {