You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

40 lines
933 B

//
// GmeContactsService.swift
// GMERemittance
//
// Created by gme_2 on 25/08/2018.
//Copyright © 2018 Gobal Money Express Co. Ltd. All rights reserved.
//
import Foundation
class GmeContactsService: GmeContactsServiceType {
func fetchBranches(
success: @escaping ([Branch]?) -> Void,
failure: @escaping (Error) -> Void
) {
let url = baseUrlWithoutVersion + "/v2/reward/branchInfo"
auth.request(
method: .post,
url: url,
params: nil,
success: { (response: BranchContainer) in
if (response.errorCode ?? "") == "1" {
let error = NSError.init(
domain: "Network",
code: 0,
userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]
)
failure(error)
} else {
success(response.data)
}
},
failure: { (error) in
failure(error)
}
)
}
}