Skip to content

Commit fc80d11

Browse files
authored
Merge pull request #394 from Planetable/minor-fixes-api-controller
Update deprecated methods in API service.
2 parents 3b35d3d + c1428fe commit fc80d11

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Planet/API/PlanetAPIController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ class PlanetAPIController: NSObject, ObservableObject {
392392
} ?? []
393393

394394
// Set the method
395-
httpRequest.method = vaporRequest.method.string
395+
httpRequest.method = vaporRequest.method.rawValue
396396

397397
// Set the headers
398398
for (name, values) in vaporRequest.headers {

Planet/API/PlanetAPILogMiddleware.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,28 +32,28 @@ struct PlanetAPILogMiddleware: AsyncMiddleware {
3232
let response = try await next.respond(to: request)
3333
Task.detached(priority: .background) {
3434
await MainActor.run {
35-
self.viewModel.addLog(statusCode: response.status.code, originIP: originIP, requestURL: request.method.string + " " + request.url.path)
35+
self.viewModel.addLog(statusCode: response.status.code, originIP: originIP, requestURL: request.method.rawValue + " " + request.url.path)
3636
}
3737
}
3838
return response
3939
} catch let error as AbortError {
4040
Task.detached(priority: .utility) {
4141
await MainActor.run {
42-
self.viewModel.addLog(statusCode: error.status.code, originIP: originIP, requestURL: "\(request.method.string) \(request.url.path)", errorDescription: error.reason)
42+
self.viewModel.addLog(statusCode: error.status.code, originIP: originIP, requestURL: "\(request.method.rawValue) \(request.url.path)", errorDescription: error.reason)
4343
}
4444
}
4545
throw error
4646
} catch let error as DecodingError {
4747
Task.detached(priority: .utility) {
4848
await MainActor.run {
49-
self.viewModel.addLog(statusCode: error.status.code, originIP: originIP, requestURL: "\(request.method.string) \(request.url.path)", errorDescription: error.reason)
49+
self.viewModel.addLog(statusCode: error.status.code, originIP: originIP, requestURL: "\(request.method.rawValue) \(request.url.path)", errorDescription: error.reason)
5050
}
5151
}
5252
throw error
5353
} catch {
5454
Task.detached(priority: .utility) {
5555
await MainActor.run {
56-
self.viewModel.addLog(statusCode: 500, originIP: originIP, requestURL: "\(request.method.string) \(request.url.path)", errorDescription: error.localizedDescription)
56+
self.viewModel.addLog(statusCode: 500, originIP: originIP, requestURL: "\(request.method.rawValue) \(request.url.path)", errorDescription: error.localizedDescription)
5757
}
5858
}
5959
throw error

Planet/versioning.xcconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
CURRENT_PROJECT_VERSION = 2289
1+
CURRENT_PROJECT_VERSION = 2290

0 commit comments

Comments
 (0)