Skip to content

Commit

Permalink
Merge pull request #197 from Link-MIND/fix/#196
Browse files Browse the repository at this point in the history
[Fix] #196 - 링크 제목 편집 관련 버그 수정
  • Loading branch information
mini-min authored Sep 5, 2024
2 parents cda0574 + f4b59d2 commit 74b896b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion TOASTER-iOS/Network/Clip/ClipTargetType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Foundation

import Moya

enum DetailCategoryFilter: String {
enum DetailCategoryFilter: String, CaseIterable {
case all = "ALL"
case read = "READ"
case unread = "UNREAD"
Expand Down
24 changes: 13 additions & 11 deletions TOASTER-iOS/Present/DetailClip/View/DetailClipViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -157,21 +157,21 @@ extension DetailClipViewController: UICollectionViewDataSource {
} else {
cell.configureCell(forModel: viewModel.toastList, index: indexPath.item, isClipHidden: true)
}
deleteLinkBottomSheetView.setupDeleteLinkBottomSheetButtonAction {
self.viewModel.deleteLinkAPI(toastId: self.viewModel.toastId)
self.dismiss(animated: true) { [weak self] in
self?.showToastMessage(width: 152, status: .check, message: StringLiterals.ToastMessage.completeDeleteLink)
}
}

/// "수정하기" 클릭 시
deleteLinkBottomSheetView.setupEditLinkTitleBottomSheetButtonAction {
self.viewModel.getDetailCategoryAPI(categoryID: self.viewModel.categoryId,
filter: DetailCategoryFilter.all)
self.dismiss(animated: true) {
self.viewModel.segmentIndex = indexPath.item - 1
self.editLinkBottom.setupSheetPresentation(bottomHeight: 198)
self.present(self.editLinkBottom, animated: true)
}
}
/// "삭제" 클릭 시
deleteLinkBottomSheetView.setupDeleteLinkBottomSheetButtonAction {
self.viewModel.deleteLinkAPI(toastId: self.viewModel.toastId)
self.dismiss(animated: true) { [weak self] in
self?.showToastMessage(width: 152, status: .check, message: StringLiterals.ToastMessage.completeDeleteLink)
}
}
return cell
}

Expand Down Expand Up @@ -301,8 +301,10 @@ extension DetailClipViewController: EditLinkBottomSheetViewDelegate {

extension DetailClipViewController: PatchClipDelegate {
func patchEnd() {
viewModel.getDetailCategoryAPI(categoryID: self.viewModel.categoryId,
filter: DetailCategoryFilter.all) {
viewModel.getDetailCategoryAPI(
categoryID: self.viewModel.categoryId,
filter: DetailCategoryFilter.allCases[self.viewModel.segmentIndex]
) {
self.detailClipListCollectionView.reloadData()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ final class DetailClipViewModel: NSObject {
private var unAuthorizedAction: NormalChangeAction?
private var editLinkTitleAction: NormalChangeAction?

weak var delegate: PatchClipDelegate? = nil
weak var delegate: PatchClipDelegate?

// MARK: - Data

Expand Down

0 comments on commit 74b896b

Please sign in to comment.