very close to add to shopping list wrks
This commit is contained in:
parent
2c22f8d8e1
commit
b04f385bdb
@ -112,12 +112,6 @@ fun changePassword(ctx: Context, oldPassword: String, newPassword: String) {
|
|||||||
return requestJson<ChangePasswordRequest, Unit>(ctx, "PUT", "/api/User/change-password", request)
|
return requestJson<ChangePasswordRequest, Unit>(ctx, "PUT", "/api/User/change-password", request)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
data class ShoppingListAddRecipeRequest(val id: Int, val multiplier: Int)
|
data class ShoppingListAddRecipeRequest(val id: Int, val multiplier: Int)
|
||||||
|
|
||||||
|
@ -121,7 +121,9 @@ class DishDetailsActivity : AppCompatActivity() {
|
|||||||
progressDialog.show()
|
progressDialog.show()
|
||||||
thread {
|
thread {
|
||||||
try {
|
try {
|
||||||
AddRecipeToShoppingList(this, dishId, multiplierEditText.text.toString().toIntOrNull() ?: 1)
|
val multiplierEditText = findViewById<EditText>(R.id.ingredientMultiplier)
|
||||||
|
val multiplierText = multiplierEditText.text.toString()
|
||||||
|
AddRecipeToShoppingList(this, dishId, multiplierText.toIntOrNull() ?: 1)
|
||||||
} catch (e: ApiRequestException) {
|
} catch (e: ApiRequestException) {
|
||||||
runOnUiThread {
|
runOnUiThread {
|
||||||
Toast.makeText(this, e.message, Toast.LENGTH_LONG).show()
|
Toast.makeText(this, e.message, Toast.LENGTH_LONG).show()
|
||||||
|
Loading…
Reference in New Issue
Block a user