Skip to content

Commit

Permalink
[feat] : #15 Friend's record hide
Browse files Browse the repository at this point in the history
  • Loading branch information
SsongSik committed Jun 18, 2023
1 parent 1597df5 commit 69a4608
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ interface AddFriendsService {
Response<BasePomeResponse<BaseAllData<GetFriendRecord>>>

//기록 숨기기
@DELETE("api/v1/records/{recordId}")
@DELETE("api/v1/records/hide/{recordId}")
suspend fun deleteFriendRecord(
@Path("recordId") recordId: Int
) : Response<BasePomeResponse<DeleteFriendRecord>>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,12 @@ class FriendFragment : BaseFragment<FragmentFriendBinding>(R.layout.fragment_fri
is ApiResponse.Success -> {
hideLoading()
Toast.makeText(requireContext(), "해당 게시글을 숨겼어요", Toast.LENGTH_SHORT).show()
viewModel.getAllRecordFriend(object : CoroutineErrorHandler{
override fun onError(message: String) {
Toast.makeText(requireContext(), message, Toast.LENGTH_SHORT).show()
hideLoading()
}
})
}
is ApiResponse.Failure -> {
hideLoading()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class AddFriendsViewModel @Inject constructor(
private val _getAllFriendRecordResponse = MutableLiveData<ApiResponse<BasePomeResponse<BaseAllData<GetFriendRecord>>>>()
val getAllFriendRecordResponse : LiveData<ApiResponse<BasePomeResponse<BaseAllData<GetFriendRecord>>>> = _getAllFriendRecordResponse

//친구 기록 숨기기
private val _deleteFriendRecord = MutableLiveData<ApiResponse<BasePomeResponse<DeleteFriendRecord>>>()
val deleteFriendRecord : LiveData<ApiResponse<BasePomeResponse<DeleteFriendRecord>>> = _deleteFriendRecord

Expand Down

0 comments on commit 69a4608

Please sign in to comment.