WIP
This commit is contained in:
@@ -8,13 +8,14 @@
|
||||
import Foundation
|
||||
|
||||
struct Workout: Codable {
|
||||
let id: Int
|
||||
let name: String
|
||||
let description: String?
|
||||
let exercises: [ExerciseElement]
|
||||
let registeredUser: RegisteredUser
|
||||
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case name, description, exercises
|
||||
case name, description, exercises, id
|
||||
case registeredUser = "registered_user"
|
||||
}
|
||||
|
||||
@@ -29,6 +30,7 @@ struct Workout: Codable {
|
||||
self.name = try container.decode(String.self, forKey: .name)
|
||||
self.description = try container.decodeIfPresent(String.self, forKey: .description)
|
||||
self.registeredUser = try container.decode(RegisteredUser.self, forKey: .registeredUser)
|
||||
self.id = try container.decode(Int.self, forKey: .id)
|
||||
}
|
||||
|
||||
var exercisesSortedByCreated_at: [ExerciseElement] {
|
||||
|
||||
Reference in New Issue
Block a user