Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 30 additions & 2 deletions fast_api/routes/inbox_mail.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
)
from controller.inbox_mail import manager as inbox_mail_manager
from submodules.model.global_objects import inbox_mail as inbox_mail_go
from submodules.model.business_objects import user
from fastapi import APIRouter, HTTPException, Request
from fast_api.routes.client_response import (
get_silent_success,
Expand Down Expand Up @@ -131,7 +130,6 @@ def delete_inbox_mail_by_id(request: Request, mail_id: str):

@router.get("/new")
def has_new_inbox_mails(request: Request):

user_is_admin = auth_manager.check_is_admin(request)
user = auth_manager.get_user_by_info(request.state.info)

Expand All @@ -145,3 +143,33 @@ def has_new_inbox_mails(request: Request):
"totalNewInboxMails": total_new_inbox_mails,
}
)


@router.put("/thread/{thread_id}/unread/project")
def update_inbox_mail_threads_unread_by_project(request: Request, thread_id: str):
user_is_admin = auth_manager.check_is_admin(request)
if not user_is_admin:
raise HTTPException(status_code=403, detail="Not authorized")
inbox_mail_thread = inbox_mail_go.get_inbox_mail_thread_by_id(thread_id=thread_id)
if not inbox_mail_thread:
raise HTTPException(status_code=404, detail="Thread not found")

inbox_mail_go.update_system_support_threads_read_by_threads_project(
thread_id=thread_id
)
return get_silent_success()


@router.put("/thread/{thread_id}/unread/content")
def update_inbox_mail_threads_unread_by_content(request: Request, thread_id: str):
user_is_admin = auth_manager.check_is_admin(request)
if not user_is_admin:
raise HTTPException(status_code=403, detail="Not authorized")
inbox_mail_thread = inbox_mail_go.get_inbox_mail_thread_by_id(thread_id=thread_id)
if not inbox_mail_thread:
raise HTTPException(status_code=404, detail="Thread not found")

inbox_mail_go.update_system_support_threads_read_by_threads_content(
thread_id=thread_id
)
return get_silent_success()
2 changes: 1 addition & 1 deletion submodules/model