Skip to content

Commit

Permalink
PR Feedback - use single line for HTTPRequest() instantiation
Browse files Browse the repository at this point in the history
  • Loading branch information
scannillo committed Aug 17, 2023
1 parent d3fe188 commit 7417e15
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions Sources/CorePayments/Networking/APIClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,7 @@ public class APIClient {
headers[.contentType] = "application/json"
}

let httpRequest = HTTPRequest(
headers: headers,
method: request.method,
url: url,
body: request.body
)
let httpRequest = HTTPRequest(headers: headers, method: request.method,url: url, body: request.body)

return try await http.performRequest(httpRequest)
}
Expand All @@ -59,12 +54,7 @@ public class APIClient {
let postBody = GraphQLHTTPPostBody(query: request.query, variables: request.variables)
let postData = try JSONEncoder().encode(postBody)

let httpRequest = HTTPRequest(
headers: [.contentType: "application/json"],
method: .post,
url: url,
body: postData
)
let httpRequest = HTTPRequest(headers: [.contentType: "application/json"], method: .post, url: url, body: postData)

return try await http.performRequest(httpRequest)
}
Expand Down

0 comments on commit 7417e15

Please sign in to comment.