mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-09 15:52:40 +02:00
refactor: remove read tracking from mentions (prep for notification center)
This commit is contained in:
parent
25eb240539
commit
80e19a52cb
11 changed files with 7 additions and 227 deletions
|
|
@ -20,8 +20,6 @@ from app.services.chat_comments_service import (
|
|||
delete_comment,
|
||||
get_comments_for_message,
|
||||
get_user_mentions,
|
||||
mark_all_mentions_as_read,
|
||||
mark_mention_as_read,
|
||||
update_comment,
|
||||
)
|
||||
from app.users import current_active_user
|
||||
|
|
@ -90,28 +88,8 @@ async def remove_comment(
|
|||
@router.get("/mentions", response_model=MentionListResponse)
|
||||
async def list_mentions(
|
||||
search_space_id: int | None = None,
|
||||
unread_only: bool = False,
|
||||
session: AsyncSession = Depends(get_async_session),
|
||||
user: User = Depends(current_active_user),
|
||||
):
|
||||
"""List mentions for the current user."""
|
||||
return await get_user_mentions(session, user, search_space_id, unread_only)
|
||||
|
||||
|
||||
@router.put("/mentions/{mention_id}/read")
|
||||
async def read_mention(
|
||||
mention_id: int,
|
||||
session: AsyncSession = Depends(get_async_session),
|
||||
user: User = Depends(current_active_user),
|
||||
):
|
||||
"""Mark a specific mention as read."""
|
||||
return await mark_mention_as_read(session, mention_id, user)
|
||||
|
||||
|
||||
@router.put("/mentions/read-all")
|
||||
async def read_all_mentions(
|
||||
session: AsyncSession = Depends(get_async_session),
|
||||
user: User = Depends(current_active_user),
|
||||
):
|
||||
"""Mark all mentions as read for the current user."""
|
||||
return await mark_all_mentions_as_read(session, user)
|
||||
return await get_user_mentions(session, user, search_space_id)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue