Skip to content

Commit

Permalink
fix: Reset default value for order
Browse files Browse the repository at this point in the history
Detail:
- Set default value of order to 0 instead of null

Fixes: #1621
  • Loading branch information
anhanh11001 authored and nikit19 committed May 14, 2019
1 parent 86242f2 commit b3cec1f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,11 @@ class AttendeeViewModel(

private fun createOrder() {
val attendeeList = attendees.map { AttendeeId(it.id) }.toList()
var amount = totalAmount.value
var amount: Float = totalAmount.value ?: 0F
var paymentMode: String? = paymentOption.toLowerCase()
if (amount == null || amount <= 0) {
if (amount <= 0) {
paymentMode = resource.getString(R.string.free)
amount = null
amount = 0F
}
val eventId = event.value?.id
if (eventId != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ data class Order(
val paymentMode: String? = null,
val country: String? = null,
val status: String? = null,
val amount: Float? = null,
val amount: Float = 0F,
val identifier: String? = null,
val orderNotes: String? = null,
val completedAt: String? = null,
Expand Down

0 comments on commit b3cec1f

Please sign in to comment.