WIP
This commit is contained in:
@@ -12,7 +12,7 @@ struct Workout: Codable {
|
||||
let name: String
|
||||
let description: String?
|
||||
let exercises: [ExerciseElement]
|
||||
let registeredUser: RegisteredUser
|
||||
let registeredUser: RegisteredUser?
|
||||
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case name, description, exercises, id
|
||||
@@ -29,7 +29,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.registeredUser = try container.decodeIfPresent(RegisteredUser.self, forKey: .registeredUser)
|
||||
self.id = try container.decode(Int.self, forKey: .id)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user