mirror of
https://github.com/AU-COVIDSafe/mobile-ios.git
synced 2025-04-19 21:15:21 +00:00
COVIDSafe code from version 2.2 (#42)
This commit is contained in:
parent
9e6e4604ef
commit
f14aa60482
67 changed files with 3645 additions and 464 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue