Skip to content

Commit

Permalink
fix: merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanStepanok committed Jun 3, 2024
1 parent 3f899a7 commit 9462af1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Core/Core/Data/Model/Data_PrimaryEnrollment.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public extension DataLayer {
public let certificate: DataLayer.Certificate?
public let courseModes: [CourseMode]?
public let courseStatus: CourseStatus?
public let progress: CourseProgress?
public let progress: DataLayer.CourseProgress?
public let courseAssignments: CourseAssignments?

enum CodingKeys: String, CodingKey {
Expand Down
15 changes: 0 additions & 15 deletions Course/Course/Data/Model/Data_CourseOutlineResponse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -233,19 +233,4 @@ public extension DataLayer {
case streamPriority = "stream_priority"
}
}

struct CourseProgress: Codable {
public let totalAssignmentsCount: Int?
public let assignmentsCompleted: Int?

public init(totalAssignmentsCount: Int, assignmentsCompleted: Int) {
self.totalAssignmentsCount = totalAssignmentsCount
self.assignmentsCompleted = assignmentsCompleted
}

enum CodingKeys: String, CodingKey {
case totalAssignmentsCount = "total_assignments_count"
case assignmentsCompleted = "assignments_completed"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,8 @@ struct CustomDisclosureGroup_Previews: PreviewProvider {
courseStart: Date(),
courseEnd: nil,
enrollmentStart: Date(),
enrollmentEnd: nil,
enrollmentEnd: nil,
lastVisitedBlockID: nil,
coreAnalytics: CoreAnalyticsMock()
)
Task {
Expand Down
6 changes: 3 additions & 3 deletions OpenEdX/Data/CoursePersistence.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public class CoursePersistence: CoursePersistenceProtocol {

let requestBlocks = CDCourseBlock.fetchRequest()
requestBlocks.predicate = NSPredicate(format: "courseID = %@", courseID)

let blocks = try? context.fetch(requestBlocks).map {
let userViewData = DataLayer.CourseDetailUserViewData(
transcripts: $0.transcripts?.jsonStringToDictionary() as? [String: String],
Expand Down Expand Up @@ -148,8 +148,8 @@ public class CoursePersistence: CoursePersistenceProtocol {
org: structure.org ?? "",
isSelfPaced: structure.isSelfPaced,
courseProgress: DataLayer.CourseProgress(
totalAssignmentsCount: Int(structure.totalAssignmentsCount),
assignmentsCompleted: Int(structure.assignmentsCompleted)
assignmentsCompleted: Int(structure.assignmentsCompleted),
totalAssignmentsCount: Int(structure.totalAssignmentsCount)
)
)
}
Expand Down

0 comments on commit 9462af1

Please sign in to comment.