|
|
@ -45,10 +45,10 @@ protocol DeleteRecipientService: ApiServiceType { |
|
|
|
|
|
|
|
extension DeleteRecipientService { |
|
|
|
func deleteRecipient(username: String, reciepient: Recipient, success: @escaping (Recipient?) -> (), failure: @escaping (Error) -> ()) { |
|
|
|
let url = baseUrl + "mobile/receiver/remove/" + username |
|
|
|
let params = ["receiverId": "\(reciepient.recipientId ?? "")"] |
|
|
|
let url = baseUrl + "mobile/receiver/remove/" + username + "/?receiverId=\(reciepient.recipientId ?? "")" |
|
|
|
// let params = ["receiverId": "\(reciepient.recipientId ?? "")"] |
|
|
|
|
|
|
|
auth.request(method: .post, url: url, params: params, encoding: URLEncoding.default, success: { (response: RecipientContainer) in |
|
|
|
auth.request(method: .post, url: url, params: nil, encoding: URLEncoding.default, success: { (response: RecipientContainer) in |
|
|
|
if (response.errorCode ?? "") == "1" { |
|
|
|
let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) |
|
|
|
failure(error) |
|
|
|