-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Quick Fix for primary enrolment data #492
Conversation
public init(from decoder: Decoder) throws { | ||
let values = try decoder.container(keyedBy: CodingKeys.self) | ||
|
||
if let dateString = try? values.decode(String.self, forKey: .auditAccessExpires) { | ||
auditAccessExpires = Date(iso8601: dateString) | ||
} else { | ||
auditAccessExpires = nil | ||
} | ||
created = try? values.decode(String.self, forKey: .created) | ||
mode = try? values.decode(String.self, forKey: .mode) | ||
isActive = try? values.decode(Bool.self, forKey: .isActive) | ||
course = try? values.decode(DashboardCourse.self, forKey: .course) | ||
certificate = try? values.decode(Certificate.self, forKey: .certificate) | ||
courseModes = try? values.decode([CourseMode].self, forKey: .courseModes) | ||
courseStatus = try? values.decode(CourseStatus.self, forKey: .courseStatus) | ||
progress = try? values.decode(CourseProgress.self, forKey: .progress) | ||
courseAssignments = try? values.decode(CourseAssignments.self, forKey: .courseAssignments) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the decoder
is only introduced for audit_access_expires
, that can be omitted by changing the auditAccessExpires
type from Date? to String?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed. changed type to String
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
8a2927d
to
f365d75
Compare
We're closing this PR and moving these changes to our own fork, as they are critical for us. After our release, we hope to find a way to contribute these changes back, thanks! |
This PR is quick fix for #491
Changed type of
auditAccessExpires
to String.