WIP
This commit is contained in:
@@ -17,9 +17,11 @@ struct Workout: Codable, Identifiable, Equatable {
|
||||
let description: String?
|
||||
let exercises: [ExerciseElement]
|
||||
let registeredUser: RegisteredUser?
|
||||
let muscles: [String]?
|
||||
let equipment: [String]?
|
||||
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case name, description, exercises, id
|
||||
case name, description, exercises, id, muscles, equipment
|
||||
case registeredUser = "registered_user"
|
||||
}
|
||||
|
||||
@@ -35,6 +37,8 @@ struct Workout: Codable, Identifiable, Equatable {
|
||||
self.description = try container.decodeIfPresent(String.self, forKey: .description)
|
||||
self.registeredUser = try container.decodeIfPresent(RegisteredUser.self, forKey: .registeredUser)
|
||||
self.id = try container.decode(Int.self, forKey: .id)
|
||||
self.muscles = try container.decodeIfPresent([String].self, forKey: .muscles)
|
||||
self.equipment = try container.decodeIfPresent([String].self, forKey: .equipment)
|
||||
}
|
||||
|
||||
var exercisesSortedByCreated_at: [ExerciseElement] {
|
||||
|
||||
Reference in New Issue
Block a user