diff --git a/ENGAGEHF/ENGAGEHFStandard.swift b/ENGAGEHF/ENGAGEHFStandard.swift index ba881e9b..ef61daa0 100644 --- a/ENGAGEHF/ENGAGEHFStandard.swift +++ b/ENGAGEHF/ENGAGEHFStandard.swift @@ -16,7 +16,6 @@ import SpeziAccount import SpeziFirebaseAccountStorage import SpeziFirestore import SpeziHealthKit -import SpeziMockWebService import SpeziOnboarding import SpeziQuestionnaire import SwiftUI @@ -31,7 +30,6 @@ actor ENGAGEHFStandard: Standard, EnvironmentAccessible, HealthKitConstraint, On Firestore.firestore().collection("users") } - @Dependency var mockWebService: MockWebService? @Dependency var accountStorage: FirestoreAccountStorage? @AccountReference var account: Account @@ -68,14 +66,6 @@ actor ENGAGEHFStandard: Standard, EnvironmentAccessible, HealthKitConstraint, On func add(sample: HKSample) async { - if let mockWebService { - let encoder = JSONEncoder() - encoder.outputFormatting = [.prettyPrinted, .sortedKeys, .withoutEscapingSlashes] - let jsonRepresentation = (try? String(data: encoder.encode(sample.resource), encoding: .utf8)) ?? "" - try? await mockWebService.upload(path: "healthkit/\(sample.uuid.uuidString)", body: jsonRepresentation) - return - } - do { try await healthKitDocument(id: sample.id).setData(from: sample.resource) } catch { @@ -84,11 +74,6 @@ actor ENGAGEHFStandard: Standard, EnvironmentAccessible, HealthKitConstraint, On } func remove(sample: HKDeletedObject) async { - if let mockWebService { - try? await mockWebService.remove(path: "healthkit/\(sample.uuid.uuidString)") - return - } - do { try await healthKitDocument(id: sample.uuid).delete() } catch { @@ -99,12 +84,6 @@ actor ENGAGEHFStandard: Standard, EnvironmentAccessible, HealthKitConstraint, On func add(response: ModelsR4.QuestionnaireResponse) async { let id = response.identifier?.value?.value?.string ?? UUID().uuidString - if let mockWebService { - let jsonRepresentation = (try? String(data: JSONEncoder().encode(response), encoding: .utf8)) ?? "" - try? await mockWebService.upload(path: "questionnaireResponse/\(id)", body: jsonRepresentation) - return - } - do { try await userDocumentReference .collection("QuestionnaireResponse") // Add all HealthKit sources in a /QuestionnaireResponse collection.