COVIDSafe code from version 2.2 (#42)

This commit is contained in:
COVIDSafe Support 2021-02-02 11:04:43 +11:00 committed by GitHub
parent 9e6e4604ef
commit f14aa60482
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
67 changed files with 3645 additions and 464 deletions

View file

@ -8,9 +8,9 @@
import Foundation
class DataUploadS3 {
static func uploadJSONData(data: Data, presignedUrl: String, completion: @escaping (Bool, Swift.Error?) -> Void) {
static func uploadJSONData(data: Data, presignedUrl: String, completion: @escaping (Bool, Swift.Error?, String?) -> Void) {
guard let url = URL(string: presignedUrl) else {
completion(false, nil)
completion(false, nil, "[102] S3")
return
}
var request = URLRequest(url: url)
@ -22,9 +22,9 @@ class DataUploadS3 {
).validate().response { (response) in
switch response.result {
case .success:
completion(true, nil)
completion(true, nil, nil)
case let .failure(error):
completion(false, error)
completion(false, error, "[\(response.response?.statusCode ?? 000))] S3")
}
}
uploadRequest.resume()