COVIDSafe code from version 1.1

This commit is contained in:
covidsafe-support 2020-05-08 17:49:14 +10:00
commit 3640e52eb2
330 changed files with 261540 additions and 0 deletions

View file

@ -0,0 +1,26 @@
// Copyright © 2020 Australian Government All rights reserved.
import Foundation
class GetJMCTargeAction: AsyncAction {
let onComplete: (Outcome<JMCTarget>) -> Void
init(onComplete: @escaping (Outcome<JMCTarget>) -> Void) {
self.onComplete = onComplete
super.init()
}
override func run() {
do {
let target = try JMCTarget.createTargetFromJSONOnDisk()
finishedExecutingOperationWithOutcome(.success(target))
} catch {
finishedExecutingOperationWithOutcome(.error(error))
}
}
func finishedExecutingOperationWithOutcome(_ outcome: Outcome<JMCTarget>) {
finishedExecutingOperation()
onComplete(outcome)
}
}