Skip to content

Commit 1948d6a

Browse files
committed
✨ 게시글을 불러올 때 최신순으로 보여주도록 변경
1 parent 74bd26e commit 1948d6a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

data/src/main/java/com/whyranoid/data/Post/PostDataSource.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.whyranoid.data.Post
22

33
import com.google.firebase.firestore.FirebaseFirestore
4+
import com.google.firebase.firestore.Query
45
import com.whyranoid.data.constant.CollectionId
56
import com.whyranoid.data.model.GroupInfoResponse
67
import com.whyranoid.data.model.RecruitPostResponse
@@ -26,6 +27,7 @@ class PostDataSource @Inject constructor(
2627
fun getAllPostFlow(): Flow<List<Post>> =
2728
callbackFlow {
2829
db.collection(CollectionId.POST_COLLECTION)
30+
.orderBy("updatedAt", Query.Direction.DESCENDING)
2931
.addSnapshotListener { snapshot, _ ->
3032
val recruitPostList = mutableListOf<Post>()
3133
snapshot?.forEach { docuemnt ->

0 commit comments

Comments
 (0)