Commenting out the code to parse events

pull/68/head
Oguzhan Gungor 7 years ago
parent 8016f83475
commit e92a664ab6
  1. 19
      Trust/Redeem/Rest/EventsRest.swift

@ -18,17 +18,18 @@ public class EventsRest {
completion(.failure(AnyError(response.error!))) completion(.failure(AnyError(response.error!)))
return return
} }
guard let jsonData = response.data else { // TODO: Fix this
completion(.failure(AnyError(RestError.invalidResponse("JSON is invalid")))) // guard let jsonData = response.data else {
return // completion(.failure(AnyError(RestError.invalidResponse("JSON is invalid"))))
} // return
// }
if 200...299 ~= statusCode { // success if 200...299 ~= statusCode { // success
guard let events: [Event] = Event.from(data: jsonData) else { // guard let events: [Event] = Event.from(data: jsonData) else {
completion(.failure(AnyError(RestError.invalidResponse("Could not parse data")))) // completion(.failure(AnyError(RestError.invalidResponse("Could not parse data"))))
return // return
} // }
completion(.success(events)) completion(.success([]))
} else { } else {
completion(.failure(AnyError(RestError.invalidResponse("Could not parse data")))) completion(.failure(AnyError(RestError.invalidResponse("Could not parse data"))))
} }

Loading…
Cancel
Save