Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX/#160] 유저 리뷰 수정 #165

Merged
merged 2 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class ReviewViewModel @Inject constructor(
}

fun addSelectDetailFriendList(selectFriendDetail: ReviewFriend) {
_selectDetailFriendList.removeAll { it.id == selectFriendDetail.id }
_selectDetailFriendList.add(selectFriendDetail)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.teumteum.data.datasource.remote

import com.teumteum.data.model.request.RequestReviewFriend
import com.teumteum.data.model.request.RequestReviewFriends
import com.teumteum.data.model.response.ResponseGroup
import com.teumteum.data.model.response.ResponseMeeting
import com.teumteum.data.model.response.ResponseReviewFriend
Expand Down Expand Up @@ -91,7 +91,7 @@ class RemoteGroupDataSource @Inject constructor(

suspend fun postRegisterReview(
meetingId: Long,
requestReviewFriends: List<RequestReviewFriend>
requestReviewFriends: RequestReviewFriends
): Boolean {
return service.postRegisterReview(meetingId, requestReviewFriends).isSuccessful
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ package com.teumteum.data.model.request
import com.teumteum.domain.entity.ReviewFriend
import kotlinx.serialization.Serializable

@Serializable
data class RequestReviewFriends(
val reviews: List<RequestReviewFriend>
)

@Serializable
data class RequestReviewFriend(
val id: Long,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package com.teumteum.data.repository
import android.util.Log
import com.google.gson.Gson
import com.teumteum.data.datasource.remote.RemoteGroupDataSource
import com.teumteum.data.model.request.RequestReviewFriends
import com.teumteum.data.model.request.toBody
import com.teumteum.data.model.request.toRequestReviewFriend
import com.teumteum.domain.TeumTeumDataStore
import com.teumteum.domain.entity.Meeting
import com.teumteum.domain.entity.MoimEntity
import com.teumteum.domain.entity.ReviewFriend
Expand Down Expand Up @@ -107,7 +107,7 @@ class GroupRepositoryImpl @Inject constructor(
request: List<ReviewFriend>
): Result<Boolean> {
return runCatching {
dataSource.postRegisterReview(meetingId, request.map { it.toRequestReviewFriend() })
dataSource.postRegisterReview(meetingId, RequestReviewFriends(request.map { it.toRequestReviewFriend() }))
}
}
override suspend fun saveBookmark(meetingId: Long): Result<Boolean> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.teumteum.data.service

import com.teumteum.data.model.request.RequestReviewFriend
import com.teumteum.data.model.request.RequestReviewFriends
import com.teumteum.data.model.response.ResponseGroup
import com.teumteum.data.model.response.ResponseMeeting
import com.teumteum.data.model.response.ResponseReviewFriend
Expand Down Expand Up @@ -89,6 +89,6 @@ interface GroupService {
@POST("users/reviews")
suspend fun postRegisterReview(
@Query("meetingId") meetingsId: Long,
@Body request: List<RequestReviewFriend>
@Body request: RequestReviewFriends
):Response<Void>
}
Loading