Skip to content

Commit

Permalink
added percentage funded (#1535)
Browse files Browse the repository at this point in the history
  • Loading branch information
Arkariang committed Feb 7, 2022
1 parent cf962f1 commit 7ce4bd0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/src/main/graphql/fragments.graphql
Expand Up @@ -28,6 +28,9 @@ fragment projectCard on Project {
goal {
... amount
}
pledged {
... amount
}
id
isWatched
launchedAt
Expand Down
Expand Up @@ -434,6 +434,7 @@ fun projectTransformer(projectFragment: ProjectCard?): Project {
val friends =
projectFragment?.friends()?.nodes()?.map { userTransformer(it.fragments().user()) }
?: emptyList()
val pledged = projectFragment?.pledged()?.fragments()?.amount()?.amount()?.toDouble() ?: 0.0
val fxRate = projectFragment?.fxRate()?.toFloat()
val deadline = projectFragment?.deadlineAt()
val goal = projectFragment?.goal()?.fragments()?.amount()?.amount()?.toDouble() ?: 0.0
Expand Down Expand Up @@ -471,6 +472,7 @@ fun projectTransformer(projectFragment: ProjectCard?): Project {
.friends(friends)
.fxRate(fxRate)
.deadline(deadline)
.pledged(pledged)
.goal(goal)
.id(id)
.isBacking(isBacking)
Expand Down

0 comments on commit 7ce4bd0

Please sign in to comment.