Skip to content

Commit

Permalink
Adding the userId to the story response, as long
Browse files Browse the repository at this point in the history
  • Loading branch information
florina-muntenescu authored and tiembo committed Aug 31, 2018
1 parent 08a927e commit f43486f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import kotlinx.android.parcel.Parcelize
*/
@Parcelize
data class StoryLinks(
@SerializedName("user") val user: String,
@SerializedName("user") val user: Long,
@SerializedName("comments") val comments: List<Long>,
@SerializedName("upvotes") val upvotes: List<String>,
@SerializedName("downvotes") val downvotes: List<String>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ fun StoryResponse.toStory() = Story(
commentHtml = comment_html,
commentCount = comment_count,
voteCount = vote_count,
userId = links?.user ?: 0,
createdAt = created_at,
links = links
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class StoryViewModelTest {
private val createdDate: Date = GregorianCalendar(2018, 1, 13).time
private val commentIds = listOf(11L, 12L)
private val storyLinks = StoryLinks(
user = "",
user = 5L,
comments = commentIds,
upvotes = emptyList(),
downvotes = emptyList()
Expand Down

0 comments on commit f43486f

Please sign in to comment.