Fix error when decoding notification that has a status field but is null
This commit is contained in:
parent
802a0ac9ba
commit
9d1c3f1410
|
@ -30,11 +30,7 @@ public class Notification: Decodable {
|
||||||
}
|
}
|
||||||
self.createdAt = try container.decode(Date.self, forKey: .createdAt)
|
self.createdAt = try container.decode(Date.self, forKey: .createdAt)
|
||||||
self.account = try container.decode(Account.self, forKey: .account)
|
self.account = try container.decode(Account.self, forKey: .account)
|
||||||
if container.contains(.status) {
|
self.status = try container.decodeIfPresent(Status.self, forKey: .status)
|
||||||
self.status = try container.decode(Status.self, forKey: .status)
|
|
||||||
} else {
|
|
||||||
self.status = nil
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static func dismiss(id notificationID: String) -> Request<Empty> {
|
public static func dismiss(id notificationID: String) -> Request<Empty> {
|
||||||
|
|
Loading…
Reference in New Issue