mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-06 20:15:17 +02:00
feat(gateway): implement search space management for messaging channels
This commit is contained in:
parent
455a3ee021
commit
2d1a6be776
3 changed files with 205 additions and 40 deletions
|
|
@ -21,6 +21,7 @@ from app.db import (
|
|||
)
|
||||
from app.gateway.whatsapp.adapter_baileys import WhatsAppBaileysAdapter
|
||||
from app.users import current_active_user
|
||||
from app.utils.rbac import check_search_space_access
|
||||
|
||||
router = APIRouter(prefix="/gateway/whatsapp/baileys", tags=["gateway"])
|
||||
|
||||
|
|
@ -61,6 +62,7 @@ async def request_pairing_code(
|
|||
session: AsyncSession = Depends(get_async_session),
|
||||
) -> dict[str, Any]:
|
||||
_ensure_baileys_enabled()
|
||||
await check_search_space_access(session, user, body.search_space_id)
|
||||
adapter = WhatsAppBaileysAdapter()
|
||||
try:
|
||||
pairing = await adapter.request_pairing_code(phone_number=body.phone_number)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue