Skip to content

Commit

Permalink
fix: courses persisting even after refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
IamMuuo committed Sep 12, 2024
1 parent 7b22f45 commit d071867
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/controllers/courses_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class CoursesController extends GetxController {
courses.value = r.map((e) => Course.fromJson(e)).toList();

/// Write the courses to local db
CourseModelHelper().truncate();
for (final course in courses) {
CourseModelHelper().create(course.toJson());
}
Expand Down

0 comments on commit d071867

Please sign in to comment.