Skip to content
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

Closed
wants to merge 2 commits into from

Conversation

rnr
Copy link
Contributor

@rnr rnr commented Jul 11, 2024

This PR is quick fix for #491
Changed type of auditAccessExpires to String.

@rnr rnr changed the base branch from main to develop July 11, 2024 12:59
@rnr rnr linked an issue Jul 11, 2024 that may be closed by this pull request
forgotvas
forgotvas previously approved these changes Jul 11, 2024
Comment on lines 55 to 72
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)
}
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

@saeedbashir saeedbashir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@rnr rnr force-pushed the fix/PrimaryEnrollment_data branch from 8a2927d to f365d75 Compare July 15, 2024 09:48
@rnr
Copy link
Contributor Author

rnr commented Jul 17, 2024

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!

@rnr rnr closed this Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[iOS] Issue for PrimaryEnrollment data getting
3 participants