From 964748f2258b3a634ecdb4a605c516b90753f599 Mon Sep 17 00:00:00 2001 From: LennartSchmidtKern Date: Mon, 12 Jan 2026 11:42:16 +0100 Subject: [PATCH 1/4] update mail unread all --- fast_api/routes/inbox_mail.py | 31 +++++++++++++++++++++++++++++++ submodules/model | 2 +- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/fast_api/routes/inbox_mail.py b/fast_api/routes/inbox_mail.py index 5f50b0c1..7454c307 100644 --- a/fast_api/routes/inbox_mail.py +++ b/fast_api/routes/inbox_mail.py @@ -145,3 +145,34 @@ 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) + 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") + + if not user_is_admin: + raise HTTPException(status_code=403, detail="Not authorized") + 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) + 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") + + if not user_is_admin: + raise HTTPException(status_code=403, detail="Not authorized") + + inbox_mail_go.update_system_support_threads_read_by_threads_content( + thread_id=thread_id + ) + return get_silent_success() diff --git a/submodules/model b/submodules/model index 105e7c78..d22e8832 160000 --- a/submodules/model +++ b/submodules/model @@ -1 +1 @@ -Subproject commit 105e7c784adc2e76009e31ad4a3347fd115832bc +Subproject commit d22e8832d3f2b9f79df79cbad3ab20aff4bbc3ec From 65d871ddb297f98371d5f3373844abd58ca4ce31 Mon Sep 17 00:00:00 2001 From: JWittmeyer Date: Mon, 12 Jan 2026 16:33:10 +0100 Subject: [PATCH 2/4] PR changes --- fast_api/routes/inbox_mail.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/fast_api/routes/inbox_mail.py b/fast_api/routes/inbox_mail.py index 7454c307..6c897263 100644 --- a/fast_api/routes/inbox_mail.py +++ b/fast_api/routes/inbox_mail.py @@ -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, @@ -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) @@ -150,12 +148,12 @@ def has_new_inbox_mails(request: Request): @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") - if not user_is_admin: - raise HTTPException(status_code=403, detail="Not authorized") inbox_mail_go.update_system_support_threads_read_by_threads_project( thread_id=thread_id ) @@ -165,13 +163,12 @@ def update_inbox_mail_threads_unread_by_project(request: Request, thread_id: str @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") - if not user_is_admin: - raise HTTPException(status_code=403, detail="Not authorized") - inbox_mail_go.update_system_support_threads_read_by_threads_content( thread_id=thread_id ) From 03babc9dfdd07f8a04d9a214cbd19bed50a9f255 Mon Sep 17 00:00:00 2001 From: LennartSchmidtKern Date: Mon, 12 Jan 2026 17:04:13 +0100 Subject: [PATCH 3/4] sudmodules --- submodules/model | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/model b/submodules/model index d22e8832..df219946 160000 --- a/submodules/model +++ b/submodules/model @@ -1 +1 @@ -Subproject commit d22e8832d3f2b9f79df79cbad3ab20aff4bbc3ec +Subproject commit df2199461f2a7f119d36d2a409003ab86011f863 From 5e6be2c5333a7a3d20fabb666af375967c17f4f4 Mon Sep 17 00:00:00 2001 From: JWittmeyer Date: Mon, 12 Jan 2026 17:11:37 +0100 Subject: [PATCH 4/4] Submodule merge --- submodules/model | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/model b/submodules/model index df219946..1b4fda1f 160000 --- a/submodules/model +++ b/submodules/model @@ -1 +1 @@ -Subproject commit df2199461f2a7f119d36d2a409003ab86011f863 +Subproject commit 1b4fda1f114a2d3209812374ee970ea2bd7ffc2e