WIP
This commit is contained in:
@@ -20,10 +20,16 @@ struct Workout: Codable, Identifiable, Equatable {
|
||||
let muscles: [String]?
|
||||
let equipment: [String]?
|
||||
let exercise_count: Int?
|
||||
let maleVideos: [String]?
|
||||
let femaleVideos: [String]?
|
||||
let bothVideos: [String]?
|
||||
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case name, description, exercises, id, muscles, equipment, exercise_count
|
||||
case registeredUser = "registered_user"
|
||||
case maleVideos = "male_videos"
|
||||
case femaleVideos = "female_videos"
|
||||
case bothVideos = "both_videos"
|
||||
}
|
||||
|
||||
init(from decoder: Decoder) throws {
|
||||
@@ -41,6 +47,9 @@ struct Workout: Codable, Identifiable, Equatable {
|
||||
self.muscles = try container.decodeIfPresent([String].self, forKey: .muscles)
|
||||
self.equipment = try container.decodeIfPresent([String].self, forKey: .equipment)
|
||||
self.exercise_count = try container.decodeIfPresent(Int.self, forKey: .exercise_count)
|
||||
self.femaleVideos = try container.decodeIfPresent([String].self, forKey: .femaleVideos)
|
||||
self.maleVideos = try container.decodeIfPresent([String].self, forKey: .maleVideos)
|
||||
self.bothVideos = try container.decodeIfPresent([String].self, forKey: .bothVideos)
|
||||
}
|
||||
|
||||
var exercisesSortedByCreated_at: [ExerciseElement] {
|
||||
|
||||
Reference in New Issue
Block a user