This commit is contained in:
Trey t
2023-07-29 12:03:40 -05:00
parent 1997abeff6
commit 173f39cc5f
7 changed files with 49 additions and 12 deletions

View File

@@ -17,7 +17,6 @@ struct Workout: Codable, Identifiable, Equatable {
let description: String?
let supersets: [Superset]?
let registeredUser: RegisteredUser?
let femaleVideos, maleVideos, bothVideos: [String]?
let muscles: [String]?
let equipment: [String]?
let exercise_count: Int?
@@ -28,9 +27,6 @@ struct Workout: Codable, Identifiable, Equatable {
enum CodingKeys: String, CodingKey {
case id, name, description, supersets, exercise_count, muscles, equipment
case registeredUser = "registered_user"
case maleVideos = "male_videos"
case femaleVideos = "female_videos"
case bothVideos = "both_videos"
case createdAt = "created_at"
case estimatedTime = "estimated_time"
case allSupersetExecercise = "all_superset_exercise"
@@ -43,9 +39,6 @@ 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.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)
self.supersets = try container.decodeIfPresent([Superset].self, forKey: .supersets)
self.equipment = try container.decodeIfPresent([String].self, forKey: .equipment)