Skip to content

Commit

Permalink
Ensure notes is not accidentally erased
Browse files Browse the repository at this point in the history
  • Loading branch information
KOEPKEJR committed Nov 13, 2023
1 parent 5a7febd commit 12229d8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions monarchmoney/monarchmoney.py
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ async def update_transaction(
}
}

# Special handling as these items can never be null
# Special handling as these items can never be null
if amount:
variables["input"].update({"amount": amount})
if date:
Expand All @@ -738,12 +738,15 @@ async def update_transaction(
variables["input"].update({"hideFromReports": bool(hide_from_reports)})
if needs_review is not None:
variables["input"].update({"needsReview": bool(needs_review)})


# Ensure that notes is explicitly included to avoid errant erasing of existing notes
if notes is not None:
variables["input"].update({"notes": notes})

# Remaining items
variables["input"].update({"category": category_id})
variables["input"].update({"name": merchant_name})
variables["input"].update({"goalId": goal_id})
variables["input"].update({"notes": notes})

return await self.gql_call(
operation="Web_TransactionDrawerUpdateTransaction",
Expand Down

0 comments on commit 12229d8

Please sign in to comment.