fix: rename dialog_id to chat_id in chat_channel (backend + frontend) (#16096)

## Summary

- The `ChatChannel` DB column was renamed from `dialog_id` to `chat_id`
via a migration (added in a prior commit).
- Aligns the REST API layer (`chat_channel_api.py`,
`chat_channel_service.py`) to use `chat_id` consistently.
- Updates the frontend (`interface.ts`, `hooks.ts`,
`connect-dialog-modal.tsx`, `added-channel-card.tsx`) to read/write
`chat_id` instead of `dialog_id`.
- The joined `dialog_name` alias in the list query is unchanged (backend
still returns it under that name).

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Kevin Hu
2026-06-16 19:02:20 +08:00
committed by GitHub
parent 6bfaa3f21e
commit 15f50e5cb2
7 changed files with 16 additions and 15 deletions

View File

@@ -34,7 +34,7 @@ class ChatChannelService(CommonService):
cls.model.id,
cls.model.name,
cls.model.channel,
cls.model.dialog_id,
cls.model.chat_id,
cls.model.status,
Dialog.name.alias("dialog_name"),
]
@@ -43,7 +43,7 @@ class ChatChannelService(CommonService):
.join(
Dialog,
join_type=JOIN.LEFT_OUTER,
on=(Dialog.id == cls.model.dialog_id),
on=(Dialog.id == cls.model.chat_id),
)
.where(cls.model.tenant_id == tenant_id)
.order_by(cls.model.create_time.desc())