mirror of
https://github.com/we-promise/sure.git
synced 2026-04-07 06:21:23 +00:00
Fix: Remove blank amount from transaction entry parameters (#1178)
Co-authored-by: sentry[bot] <39604003+sentry[bot]@users.noreply.github.com>
This commit is contained in:
@@ -331,6 +331,8 @@ class TransactionsController < ApplicationController
|
||||
|
||||
nature = entry_params.delete(:nature)
|
||||
|
||||
entry_params.delete(:amount) if entry_params[:amount].blank?
|
||||
|
||||
if nature.present? && entry_params[:amount].present?
|
||||
signed_amount = nature == "inflow" ? -entry_params[:amount].to_d : entry_params[:amount].to_d
|
||||
entry_params = entry_params.merge(amount: signed_amount)
|
||||
|
||||
Reference in New Issue
Block a user