Skip to content

Commit

Permalink
✨ 챌린지 완료 유즈케이스 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
soopeach committed Nov 20, 2024
1 parent 5a16e30 commit 40bc09c
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.whyranoid.domain.usecase

import com.whyranoid.domain.repository.ChallengeRepository
import javax.inject.Inject

class CompleteChallengeUseCase @Inject constructor(
private val challengeRepository: ChallengeRepository,
private val getMyUidUseCase: GetMyUidUseCase
) {
suspend operator fun invoke(challengeId: Int): Result<Unit> {
val myId = getMyUidUseCase()
return challengeRepository.changeChallengeStatus(challengeId,"C", myId.getOrNull()?.toInt() ?: -1)
}

}

0 comments on commit 40bc09c

Please sign in to comment.