mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-15 18:07:03 +05:30
android: add ViewModel method to get user profile
This commit is contained in:
parent
c589ef483e
commit
f30113b483
1 changed files with 3 additions and 0 deletions
|
@ -76,6 +76,9 @@ constructor(
|
||||||
suspend fun getPostComments(postId: String) =
|
suspend fun getPostComments(postId: String) =
|
||||||
withContext(Dispatchers.IO) { api.getPostDetails(postId) }
|
withContext(Dispatchers.IO) { api.getPostDetails(postId) }
|
||||||
|
|
||||||
|
suspend fun getUserProfile(username: String) =
|
||||||
|
withContext(Dispatchers.IO) { api.getUser(username) }
|
||||||
|
|
||||||
fun refreshHottestPosts() {
|
fun refreshHottestPosts() {
|
||||||
hottestPostsPagingSource?.invalidate()
|
hottestPostsPagingSource?.invalidate()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue