Skip to content

Commit

Permalink
chore: update SDKs to new RC version
Browse files Browse the repository at this point in the history
  • Loading branch information
christyjacob4 committed Aug 20, 2024
1 parent 260f5a5 commit 596b43e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 15 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Add the package to your `Package.swift` dependencies:

```swift
dependencies: [
.package(url: "[email protected]:appwrite/sdk-for-apple.git", from: "7.0.0-rc.1"),
.package(url: "[email protected]:appwrite/sdk-for-apple.git", from: "7.0.0-rc.2"),
],
```

Expand Down
2 changes: 1 addition & 1 deletion Sources/Appwrite/Client.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ open class Client {
"x-sdk-name": "Apple",
"x-sdk-platform": "client",
"x-sdk-language": "apple",
"x-sdk-version": "7.0.0-rc.1",
"x-sdk-version": "7.0.0-rc.2",
"x-appwrite-response-format": "1.6.0"
]

Expand Down
22 changes: 9 additions & 13 deletions Sources/Appwrite/Services/Functions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,12 @@ open class Functions: Service {
path: String? = nil,
method: AppwriteEnums.ExecutionMethod? = nil,
headers: Any? = nil,
scheduledAt: String? = nil,
onProgress: ((UploadProgress) -> Void)? = nil
scheduledAt: String? = nil
) async throws -> AppwriteModels.Execution {
let apiPath: String = "/functions/{functionId}/executions"
.replacingOccurrences(of: "{functionId}", with: functionId)

var apiParams: [String: Any?] = [
let apiParams: [String: Any?] = [
"body": body,
"async": async,
"path": path,
Expand All @@ -200,23 +199,20 @@ open class Functions: Service {
"scheduledAt": scheduledAt
]

var apiHeaders: [String: String] = [
"content-type": "multipart/form-data"
let apiHeaders: [String: String] = [
"content-type": "application/json"
]

let converter: (Any) -> AppwriteModels.Execution = { response in
return AppwriteModels.Execution.from(map: response as! [String: Any])
}

let idParamName: String? = nil
return try await client.chunkedUpload(
return try await client.call(
method: "POST",
path: apiPath,
headers: &apiHeaders,
params: &apiParams,
paramName: paramName,
idParamName: idParamName,
converter: converter,
onProgress: onProgress
headers: apiHeaders,
params: apiParams,
converter: converter
)
}

Expand Down

0 comments on commit 596b43e

Please sign in to comment.