Skip to content

Feat/#393 공통퀘스트 삭제 API 연결#405

Merged
dev-domo merged 11 commits intodevelopfrom
feat/#393-deleteCommonQuest
Mar 12, 2026
Merged

Feat/#393 공통퀘스트 삭제 API 연결#405
dev-domo merged 11 commits intodevelopfrom
feat/#393-deleteCommonQuest

Conversation

@dev-domo
Copy link
Copy Markdown
Collaborator

🔗 연결된 이슈

📄 작업 내용

  • 공통퀘스트 삭제 API를 연결했습니다
구현 내용 IPhone 16 pro IPhone 13 mini
GIF

💻 주요 코드 설명

CommonQuestBottomSheetViewController & CommonQuestHistoryViewController

  • DeleteCommonQuestDelegate를 구현해서 퀘스트 삭제 모달에서 '예'를 누르면 CommonQuestHistoryViewController로 pop되도록 구현했습니다
// CommonQuestBottomSheetViewController
protocol DeleteCommonQuestDelegate: AnyObject {
    func completeDeleteCommonQuest()
}

extension CommonQuestBottomSheetViewController {
    func bind() {
        // 다른 구독 로직 생략
        viewModel.output.deleteQuestPublisher
            .receive(on: DispatchQueue.main)
            .sink { [weak self] result in
                switch result {
                case .success():
                    ByeBooLogger.debug("삭제 성공")
                    
                    guard let self else { return }
                    
                    self.dismiss(animated: false) { [weak self] in
                        self?.deleteDelegate?.completeDeleteCommonQuest()    // 델리게이트 메서드 호출
                    }
                case .failure(let error):
                    ByeBooLogger.debug(error)
                }
            }
            .store(in: &cancellables)
    }
}

// CommonQuestHistoryViewController
extension CommonQuestHistoryViewController: DeleteCommonQuestDelegate {
    func completeDeleteCommonQuest() {
        self.navigationController?.popViewController(animated: false)
    }
}

CommonQuestContentCell

  • 날짜별로 사용자의 공통퀘스트 답변 유무에 따라 레이아웃 제약이 바뀌어야 해서 코드 수정했습니다.
extension CommonQuestContentCell {
    
    func bind(
        isAnswered: Bool,
        question: String,
        answersCount: Int
    ) {
        guideTimeLabel.isHidden = isAnswered
        moveWriteAnswerButton.isHidden = isAnswered
        questionContentLabel.text = question
        answersCountLabel.text = "\(answersCount)개의 답변"
        
        answersCountLabel.snp.remakeConstraints {
            if isAnswered {
                $0.top.equalTo(questionView.snp.bottom).offset(12.adjustedH)
            } else {
                $0.top.equalTo(moveWriteAnswerButton.snp.bottom).offset(24.adjustedH)
            }
            $0.horizontalEdges.equalToSuperview().inset(24.adjustedW)
            $0.bottom.equalToSuperview()
        }
    }
}

@dev-domo dev-domo requested review from juri123123 and y-eonee March 10, 2026 12:53
@dev-domo dev-domo self-assigned this Mar 10, 2026
@dev-domo dev-domo added the feat 새로운 기능 구현 및 API 연결 label Mar 10, 2026
@dev-domo dev-domo linked an issue Mar 10, 2026 that may be closed by this pull request
1 task
Copy link
Copy Markdown
Collaborator

@juri123123 juri123123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니당 ~

Comment on lines +30 to +31
private let yesAnswer = "예"
private let noAnswer = "아니오"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

나중에 이런 literal 값들 따로 관리할 수 있도록 하면 좋을 것 같은데 어떻게 생각하세용 ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아 좋아요좋아요 Literal 폴더 하나 만드시죠

Comment on lines +100 to +105
private func sendError(error: Error) {
guard let error = error as? ByeBooError else {
return
}
ByeBooLogger.error(error as ByeBooError)
reportQuestSubject.send(.failure(error))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오호

@dev-domo dev-domo merged commit bbaab60 into develop Mar 12, 2026
1 check passed
@dev-domo dev-domo deleted the feat/#393-deleteCommonQuest branch March 13, 2026 05:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat 새로운 기능 구현 및 API 연결 승준🤠

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Feat] 공통퀘스트 삭제 API 연동

2 participants