Skip to content

Commit

Permalink
fix: 아티클이 이미 테이블에 있느 경우에도 컨텐츠 조회되도록 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
hun-ca committed Jul 29, 2024
1 parent 50c8c48 commit 5c9e316
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ class ReadArticlesUseCase(

existInArticleMainCardRecords = (existInArticleMainCardRecords + joinedArticleMainCardRecords).toSet()

// 아티클 컨텐츠 조회
val selectArticleContentsRecords: List<SelectArticleContentsRecord> =
articleDao.selectArticleContents(existInArticleMainCardRecords.map { it.articleId }.toSet())
setContentsToRecords(selectArticleContentsRecords, existInArticleMainCardRecords)

// TODO: 결과를 로컬 캐시에 저장
}

// 아티클 컨텐츠 조회
val selectArticleContentsRecords: List<SelectArticleContentsRecord> =
articleDao.selectArticleContents(existInArticleMainCardRecords.map { it.articleId }.toSet())
setContentsToRecords(selectArticleContentsRecords, existInArticleMainCardRecords)

val sortedArticles = updateAndSortArticleViews(existInArticleMainCardRecords, articleViewsRecords)

val articleUseCaseOuts: List<ReadArticleUseCaseOut> = sortedArticles.map { a ->
Expand Down

0 comments on commit 5c9e316

Please sign in to comment.