Skip to content

Commit

Permalink
hotfix - 빈자리 알림 delete api (#153)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hank-Choi authored Aug 11, 2023
1 parent 74d84c2 commit 279b440
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
3 changes: 2 additions & 1 deletion api/src/main/kotlin/handler/VacancyNotifcationHandler.kt
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ class VacancyNotifcationHandler(
}

suspend fun deleteVacancyNotification(req: ServerRequest): ServerResponse = handle(req) {
val userId = req.userId
val lectureId = req.pathVariable("lectureId")

vacancyNotificationService.deleteVacancyNotification(lectureId)
vacancyNotificationService.deleteVacancyNotification(userId, lectureId)
null
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.SupervisorJob
import kotlinx.coroutines.async
import kotlinx.coroutines.awaitAll
import kotlinx.coroutines.coroutineScope
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.toList
import kotlinx.coroutines.launch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ interface VacancyNotificationRepository : CoroutineCrudRepository<VacancyNotific
fun findAllByLectureId(lectureId: String): Flow<VacancyNotification>
fun findAllByUserId(userId: String): Flow<VacancyNotification>
suspend fun existsByUserIdAndLectureId(userId: String, lectureId: String): Boolean
suspend fun deleteByLectureId(lectureId: String)
suspend fun deleteByUserIdAndLectureId(userId: String, lectureId: String)
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ interface VacancyNotificationService {
suspend fun getVacancyNotificationLectures(userId: String): List<Lecture>
suspend fun existsVacancyNotification(userId: String, lectureId: String): Boolean
suspend fun addVacancyNotification(userId: String, lectureId: String): VacancyNotification
suspend fun deleteVacancyNotification(lectureId: String)
suspend fun deleteVacancyNotification(userId: String, lectureId: String)
suspend fun deleteAll()
}

Expand Down Expand Up @@ -51,8 +51,8 @@ class VacancyNotificationServiceImpl(
trySave(VacancyNotification(userId = userId, lectureId = lectureId))
}

override suspend fun deleteVacancyNotification(lectureId: String) {
vacancyNotificationRepository.deleteByLectureId(lectureId)
override suspend fun deleteVacancyNotification(userId: String, lectureId: String) {
vacancyNotificationRepository.deleteByUserIdAndLectureId(userId, lectureId)
}

override suspend fun deleteAll() {
Expand Down

0 comments on commit 279b440

Please sign in to comment.