Skip to content

Commit

Permalink
[picta/fix] Update wrapper name body (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
damien-nd authored Jan 4, 2024
1 parent 049f388 commit 0287045
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Sources/Spyder/Builders/PropertyWrappers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public struct OptionalQueryArgument: Sendable {
}

@propertyWrapper
public struct Body: Sendable {
public struct BodyContent: Sendable {
public var wrappedValue: API.Body

public init(wrappedValue: API.Body) {
Expand Down
4 changes: 2 additions & 2 deletions Sources/Spyder/Builders/URLRequestBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ extension URLRequestBuilder {
updateQueryItems(&queryItems, argument: queryArgument)
case let optionalQueryArgument as OptionalQueryArgument:
updateQueryItems(&queryItems, argument: optionalQueryArgument)
case let body as Body:
case let body as BodyContent:
httpBody = try createBody(from: body, using: api.jsonEncoder)
default:
break
Expand Down Expand Up @@ -71,6 +71,6 @@ private func updateQueryItems(_ queryItems: inout [URLQueryItem], argument: Opti
}
}

private func createBody(from content: Body, using encoder: JSONEncoder) throws -> Data? {
private func createBody(from content: BodyContent, using encoder: JSONEncoder) throws -> Data? {
try encoder.encode(content.wrappedValue)
}

0 comments on commit 0287045

Please sign in to comment.