Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion finbot/tools/data/vendor.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,14 @@ async def update_vendor_agent_notes(
vendor_id,
agent_notes,
)
with db_session() as db:
with db_session() as db:
vendor_repo = VendorRepository(db, session_context)
vendor = vendor_repo.get_vendor(vendor_id)
if not vendor:
raise ValueError("Vendor not found")
# If agent_notes is None, no update is needed; return current data.
if agent_notes is None:
return vendor.to_dict()
existing_notes = vendor.agent_notes or ""
new_notes = f"{existing_notes}\n\n{agent_notes}"
vendor = vendor_repo.update_vendor(
Expand Down