Phase 1C: Frontend unified contact UI
This commit is contained in:
@@ -260,10 +260,10 @@ async def gather_context(
|
||||
)
|
||||
context["thread"] = [_serialize_row(m) for m in thread_result.scalars().all()]
|
||||
|
||||
if mail and mail.company_id:
|
||||
if mail and mail.contact_id:
|
||||
comp_result = await db.execute(
|
||||
select(Company)
|
||||
.where(Company.id == mail.company_id)
|
||||
.where(Company.id == mail.contact_id)
|
||||
.where(Company.tenant_id == tenant_id)
|
||||
.limit(1)
|
||||
)
|
||||
@@ -307,7 +307,7 @@ async def gather_context(
|
||||
|
||||
mail_result = await db.execute(
|
||||
select(Mail)
|
||||
.where(Mail.company_id == entity_id)
|
||||
.where(Mail.contact_id == entity_id)
|
||||
.where(Mail.tenant_id == tenant_id)
|
||||
.order_by(Mail.received_at.desc())
|
||||
.limit(10)
|
||||
@@ -321,7 +321,7 @@ async def gather_context(
|
||||
event_result = await db.execute(
|
||||
select(CalendarEntry)
|
||||
.join(CalendarEntryLink, CalendarEntryLink.entry_id == CalendarEntry.id)
|
||||
.where(CalendarEntryLink.entity_type == "company")
|
||||
.where(CalendarEntryLink.entity_type == "contact")
|
||||
.where(CalendarEntryLink.entity_id == entity_id)
|
||||
.where(CalendarEntry.tenant_id == tenant_id)
|
||||
.where(CalendarEntry.start_at > now)
|
||||
|
||||
Reference in New Issue
Block a user