rbaumbach/Utensils

Delete method is not dispatched on main queue

Closed this issue · 1 comments

This is the following code in the NetworkEngine:

public func delete<T: Codable>(baseURL: String,
                                   headers: [String: String]?,
                                   endpoint: String,
                                   parameters: [String: String]?,
                                   completionHandler: @escaping (Result<T, Error>) -> Void) {
        let urlRequestInfo = URLRequestInfo(baseURL: baseURL,
                                            headers: headers,
                                            httpMethod: .delete,
                                            endpoint: endpoint,
                                            parameters: parameters,
                                            body: nil)
        
        executeRequest(urlRequestInfo: urlRequestInfo,
                       completionHandler: completionHandler)
    }

As you can see the completion hander is not being dispatched on the main queue. This needs to be updated to be consistent with the other http verbs.

Closing.