Skip to content

Commit

Permalink
[CHORE/#3] fake repo list json 파일명 상수화
Browse files Browse the repository at this point in the history
  • Loading branch information
b1urrrr committed Apr 22, 2023
1 parent 51c3e22 commit 7183439
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ class RepoDataSource @Inject constructor(
private val assetLoader: AssetLoader,
) {
fun getRepoList(): Array<MockRepoDto> {
return assetLoader.getJsonString("fake_repo_list.json")?.let { jsonString ->
return assetLoader.getJsonString(FILE_FAKE_REPO_LIST)?.let { jsonString ->
Json.decodeFromString<Array<MockRepoDto>>(jsonString)
} ?: emptyArray()
}

companion object {
private const val FILE_FAKE_REPO_LIST = "fake_repo_list.json"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ class HomeViewModel @Inject constructor(
Timber.d("GET REPO LIST SUCCESS : $repoList")
}
.onFailure { t ->
Timber.e("GET REPO LIST FAIL : ${t.message}")
_getRepoListState.value = Failure(null)
Timber.e("GET REPO LIST FAIL : ${t.message}")
}
}
}
Expand Down

0 comments on commit 7183439

Please sign in to comment.