Skip to content

Commit

Permalink
Feat: Implement decoding with keypath #76
Browse files Browse the repository at this point in the history
- Implement fetching costco / emart-traders branch lists
- Change server urls
  • Loading branch information
jinios committed Feb 10, 2019
1 parent b96cd57 commit 65be2c9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion MartHoliday/MartHoliday/Model/DataSetter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class DataSetter<T: URLHolder, U: Codable> {
var branches = [U]()
if let response = response as? HTTPURLResponse, 200...299 ~= response.statusCode, let data = data {
do {
branches = try JSONDecoder().decode([U].self, from: data)
branches = try JSONDecoder().decode([BranchRawData].self, from: data, keyPath: "data") as! [U]
handler(mart,branches)
} catch {
handler(mart,nil)
Expand Down

0 comments on commit 65be2c9

Please sign in to comment.