quivr/backend/modules/notification/controller/notification_routes.py
Zineb El Bachiri 0782df5e37
refactor: Notification module (#1740)
# Description

- Notification module

## Checklist before requesting a review

Please delete options that are not relevant.

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my code
- [ ] I have commented hard-to-understand areas
- [ ] I have ideally added tests that prove my fix is effective or that
my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged

## Screenshots (if appropriate):
2023-11-28 14:27:39 +01:00

24 lines
560 B
Python

from uuid import UUID
from fastapi import APIRouter, Depends
from middlewares.auth import AuthBearer
from modules.notification.service.notification_service import NotificationService
notification_router = APIRouter()
notification_service = NotificationService()
@notification_router.get(
"/notifications/{chat_id}",
dependencies=[Depends(AuthBearer())],
tags=["Notification"],
)
async def get_notifications(
chat_id: UUID,
):
"""
Get notifications by chat_id
"""
return notification_service.get_chat_notifications(chat_id)