diff --git a/Sources/ParseSwift/API/API+NonParseBodyCommand.swift b/Sources/ParseSwift/API/API+NonParseBodyCommand.swift index 5c932b03b..8a87cb378 100644 --- a/Sources/ParseSwift/API/API+NonParseBodyCommand.swift +++ b/Sources/ParseSwift/API/API+NonParseBodyCommand.swift @@ -74,7 +74,7 @@ internal extension API { guard var components = URLComponents(url: url, resolvingAgainstBaseURL: false) else { return .failure(ParseError(code: .otherCause, - message: "Could not unrwrap url components for \(url)")) + message: "Could not unwrap url components for \(url)")) } components.queryItems = params diff --git a/Sources/ParseSwift/Coding/ParseCoding.swift b/Sources/ParseSwift/Coding/ParseCoding.swift index 9591c1cfa..06b5334dc 100644 --- a/Sources/ParseSwift/Coding/ParseCoding.swift +++ b/Sources/ParseSwift/Coding/ParseCoding.swift @@ -53,7 +53,7 @@ public extension ParseObject { } /// The Parse encoder is used to JSON encode all `ParseObject`s and - /// types in a way meaninful for a Parse Server to consume. + /// types in a way meaningful for a Parse Server to consume. func getEncoder() -> ParseEncoder { return Self.getEncoder() } diff --git a/Sources/ParseSwift/Types/Pointer.swift b/Sources/ParseSwift/Types/Pointer.swift index 043e16731..5deae3a55 100644 --- a/Sources/ParseSwift/Types/Pointer.swift +++ b/Sources/ParseSwift/Types/Pointer.swift @@ -115,13 +115,20 @@ public extension Pointer { Task { var options = options options.insert(.cachePolicy(.reloadIgnoringLocalCacheData)) + + let method = API.Method.GET let path = API.Endpoint.object(className: className, objectId: objectId) - await API.NonParseBodyCommand(method: .GET, - path: path) { (data) -> T in + let params: [String: String]? = { + guard let includeKeys else { return nil } + return ["include": "\(Set(includeKeys))"] + }() + let mapper = { (data) -> T in try ParseCoding.jsonDecoder().decode(T.self, from: data) - }.execute(options: options, - callbackQueue: callbackQueue, - completion: completion) + } + await API.NonParseBodyCommand(method: method, path: path, params: params, mapper: mapper) + .execute(options: options, + callbackQueue: callbackQueue, + completion: completion) } } }