Skip to content

Commit

Permalink
Merge pull request #214 from appunite/fix/change_type_of_id
Browse files Browse the repository at this point in the history
[LD-164] Change type of id to Long.
  • Loading branch information
nowakweronika authored Mar 11, 2024
2 parents 00543b7 + c7cd809 commit 0ec85eb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import kotlinx.serialization.Serializable

@Serializable
data class PullRequest(
val id: Int,
val id: Long,
val draft: Boolean,
val number: Int,
@SerialName("repository_url")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import com.appunite.loudius.network.model.PullRequest
import kotlinx.coroutines.launch

sealed class PulLRequestsAction {
data class ItemClick(val id: Int) : PulLRequestsAction()
data class ItemClick(val id: Long) : PulLRequestsAction()
object OnNavigateToReviewers : PulLRequestsAction()
object RetryClick : PulLRequestsAction()
}
Expand Down Expand Up @@ -102,7 +102,7 @@ class PullRequestsViewModel(
is PulLRequestsAction.RetryClick -> fetchData()
}

private fun navigateToReviewers(itemClickedId: Int) {
private fun navigateToReviewers(itemClickedId: Long) {
val successData = state.data as? Data.Success ?: return
val index = successData.pullRequests.indexOfFirst { it.id == itemClickedId }
val itemClickedData = successData.pullRequests[index]
Expand Down
4 changes: 2 additions & 2 deletions app/src/test/java/com/appunite/loudius/util/Defaults.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ object Defaults {
val date2: Instant = Instant.parse("2022-01-29T11:00:00Z")
val date3: Instant = Instant.parse("2022-01-29T12:00:00Z")

fun pullRequest(id: Int = 1) = PullRequest(
fun pullRequest(id: Long = 1) = PullRequest(
id = id,
draft = false,
number = id,
number = id.toInt(),
repositoryUrl = "https://api.github.com/repos/exampleOwner/exampleRepo",
title = "example title",
Instant.parse("2023-03-07T08:21:45Z").plus(id.toLong().hours)
Expand Down

0 comments on commit 0ec85eb

Please sign in to comment.