added firebase collection routes to object
This commit is contained in:
parent
447cae2662
commit
7c42f2fbd1
4 changed files with 12 additions and 17 deletions
|
@ -31,13 +31,8 @@ class FireBaseSessionDAO @Inject constructor(
|
|||
}
|
||||
|
||||
private fun currentUserSessionsCollection(): CollectionReference =
|
||||
firestore.collection(USER_COLLECTION)
|
||||
firestore.collection(FirebaseCollectionRoutes.USER_COLLECTION)
|
||||
.document(auth.currentUserId)
|
||||
.collection(SESSION_COLLECTION)
|
||||
|
||||
companion object {
|
||||
private const val SESSION_COLLECTION = "sessions"
|
||||
private const val USER_COLLECTION = "users"
|
||||
}
|
||||
.collection(FirebaseCollectionRoutes.SESSION_COLLECTION)
|
||||
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package be.ugent.sel.studeez.domain.implementation
|
||||
|
||||
object FirebaseCollectionRoutes {
|
||||
const val SESSION_COLLECTION = "sessions"
|
||||
const val USER_COLLECTION = "users"
|
||||
const val TIMER_COLLECTION = "timers"
|
||||
|
||||
}
|
|
@ -50,14 +50,8 @@ class FirebaseTimerDAO @Inject constructor(
|
|||
}
|
||||
|
||||
private fun currentUserTimersCollection(): CollectionReference =
|
||||
firestore.collection(USER_COLLECTION)
|
||||
firestore.collection(FirebaseCollectionRoutes.USER_COLLECTION)
|
||||
.document(auth.currentUserId)
|
||||
.collection(TIMER_COLLECTION)
|
||||
|
||||
|
||||
companion object {
|
||||
private const val TIMER_COLLECTION = "timers"
|
||||
private const val USER_COLLECTION = "users"
|
||||
}
|
||||
.collection(FirebaseCollectionRoutes.TIMER_COLLECTION)
|
||||
|
||||
}
|
|
@ -3,8 +3,6 @@ package be.ugent.sel.studeez.screens.home
|
|||
import be.ugent.sel.studeez.domain.AccountDAO
|
||||
import be.ugent.sel.studeez.domain.LogService
|
||||
import be.ugent.sel.studeez.navigation.StudeezDestinations
|
||||
import be.ugent.sel.studeez.navigation.StudeezDestinations.HOME_SCREEN
|
||||
import be.ugent.sel.studeez.navigation.StudeezDestinations.LOGIN_SCREEN
|
||||
import be.ugent.sel.studeez.screens.StudeezViewModel
|
||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||
import javax.inject.Inject
|
||||
|
|
Reference in a new issue