Skip to content

Commit e465631

Browse files
feat(teams): Use CoursesRepository in TeamCoursesFragment
Refactored TeamCoursesFragment to use CoursesRepository instead of direct Realm access. - Injected CoursesRepository into TeamCoursesFragment's superclass. - Added getCoursesByIds(ids: List<String>) method to the CoursesRepository interface and its implementation. - Replaced the direct mRealm.where() call in setupCoursesList() with a call to the new repository method within a lifecycle-aware coroutine. - Fixed a build error by removing a duplicate `coursesRepository` property that conflicted with the one inherited from `BaseResourceFragment`. This change improves architectural separation of concerns and makes the fragment independent of the underlying data source implementation.
1 parent 7a8e38f commit e465631

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

app/src/main/java/org/ole/planet/myplanet/ui/teams/courses/TeamCoursesFragment.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,9 @@ import kotlinx.coroutines.launch
1010
import org.ole.planet.myplanet.databinding.FragmentTeamCourseBinding
1111
import org.ole.planet.myplanet.model.RealmMyCourse
1212
import org.ole.planet.myplanet.model.RealmNews
13-
import org.ole.planet.myplanet.repository.CoursesRepository
1413
import org.ole.planet.myplanet.ui.teams.BaseTeamFragment
15-
import javax.inject.Inject
1614

1715
class TeamCoursesFragment : BaseTeamFragment() {
18-
@Inject
19-
lateinit var coursesRepository: CoursesRepository
2016
private var _binding: FragmentTeamCourseBinding? = null
2117
private val binding get() = _binding!!
2218
private var adapterTeamCourse: TeamCoursesAdapter? = null

0 commit comments

Comments
 (0)