Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix account transaction form resetting amount to 0 #1133

Merged
merged 1 commit into from
Aug 26, 2024
Merged

Conversation

zachgoll
Copy link
Collaborator

Fixes #1132

@@ -12,8 +12,7 @@ def index
end

def update
@entry.update!(entry_params.merge(amount: amount))
@entry.sync_account_later
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the sync_later because this triggers a refresh of the entire page (via the Sync broadcasts) which gets annoying for updating transaction details. This will cause out-of-sync data if the user changes the amount or date, but will be updated on the next sync.

Eventually we'll want to get more granular with when we trigger the re-sync, but for now this feels like a decent tradeoff.

@@ -12,8 +12,7 @@ def index
end

def update
@entry.update!(entry_params.merge(amount: amount))
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merging in amount caused the scenario when we didn't include the param, it was calling nil.to_d, which resulted in 0

@zachgoll zachgoll merged commit 166ed4b into main Aug 26, 2024
4 checks passed
@zachgoll zachgoll deleted the zachgoll/fix-1132 branch August 26, 2024 23:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Transactions update to zero
1 participant