Skip to content

Commit

Permalink
Show only upcoming events
Browse files Browse the repository at this point in the history
  • Loading branch information
VsnGamer committed May 11, 2022
1 parent 8ea6b44 commit f514fa2
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/lib/services/database.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ class DatabaseService {

Future<UserData?> get userData {
return userDataRef
.doc(AuthService().user!.uid)
.get()
.then((value) => value.data());
.doc(AuthService().user!.uid)
.get()
.then((value) => value.data());
}

Future<List<QueryDocumentSnapshot<Course>>> get userCoursesM async {
Expand All @@ -50,8 +50,7 @@ class DatabaseService {
}

return coursesRef
.where(FieldPath.documentId,
whereIn: data.courses.toList())
.where(FieldPath.documentId, whereIn: data.courses.toList())
.get()
.then((value) => value.docs);
}
Expand All @@ -71,8 +70,8 @@ class DatabaseService {
}

return await eventsRef
.where('courseId',
whereIn: courses.map((c) => c.id).toList())
.where('courseId', whereIn: courses.map((c) => c.id).toList())
.where('deadline', isGreaterThan: DateTime.now())
.orderBy('deadline')
.get()
.then((snapshot) => snapshot.docs);
Expand Down

0 comments on commit f514fa2

Please sign in to comment.