Skip to content

Commit 508fb1d

Browse files
committed
Initial push
1 parent bbfb296 commit 508fb1d

File tree

3 files changed

+21
-8
lines changed

3 files changed

+21
-8
lines changed

templates/swift/Sources/Services/Service.swift.twig

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,7 @@ open class {{ service.name | caseUcfirst }}: Service {
131131
onProgress: onProgress
132132
)
133133
{% else %}
134-
return try await client.call(
135-
method: "{{ method.method | caseUpper }}",
136-
path: path,
137-
headers: headers,
138-
params: params{% if method.responseModel %},
139-
converter: converter
140-
{% endif %}
141-
)
134+
{{include('swift/base/requests/api.twig')}}
142135
{% endif %}
143136
{% endif %}
144137
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
let query = "?\(client.parametersToQueryString(params: params))"
2+
let url = URL(string: client.endPoint + path + query)!
3+
let callbackScheme = "appwrite-callback-\(client.config["project"] ?? "")"
4+
let group = DispatchGroup()
5+
6+
group.enter()
7+
WebAuthComponent.authenticate(url: url, callbackScheme: callbackScheme) { result in
8+
group.leave()
9+
}
10+
group.wait()
11+
12+
return true
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
return try await client.call(
2+
method: "{{ method.method | caseUpper }}",
3+
path: path,
4+
headers: headers,
5+
params: params{% if method.responseModel %},
6+
converter: converter
7+
{% endif %}
8+
)

0 commit comments

Comments
 (0)