From 62bfc3c8d95563508f55385c5a2680cd078ef3a3 Mon Sep 17 00:00:00 2001 From: Stan Girard Date: Thu, 2 May 2024 00:26:14 +0200 Subject: [PATCH] fix: Refactor chat_service.py and remove unused code (#2530) # Description Please include a summary of the changes and the related issue. Please also include relevant motivation and context. ## 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): --- backend/modules/chat/service/chat_service.py | 2 +- .../modules/notification/service/notification_service.py | 9 --------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/backend/modules/chat/service/chat_service.py b/backend/modules/chat/service/chat_service.py index c38f430fe03..c8c629e5870 100644 --- a/backend/modules/chat/service/chat_service.py +++ b/backend/modules/chat/service/chat_service.py @@ -123,7 +123,7 @@ def get_chat_history_with_notifications( chat_id: UUID, ) -> List[ChatItem]: chat_history = self.get_chat_history(str(chat_id)) - chat_notifications = notification_service.get_chat_notifications(chat_id) + chat_notifications = [] return merge_chat_history_and_notifications(chat_history, chat_notifications) def get_user_chats(self, user_id: str) -> List[Chat]: diff --git a/backend/modules/notification/service/notification_service.py b/backend/modules/notification/service/notification_service.py index 451b01b4dba..977ee4d6612 100644 --- a/backend/modules/notification/service/notification_service.py +++ b/backend/modules/notification/service/notification_service.py @@ -1,6 +1,3 @@ -from typing import List -from uuid import UUID - from models.settings import get_supabase_client from modules.notification.dto.inputs import NotificationUpdatableProperties from modules.notification.entity.notification import Notification @@ -23,12 +20,6 @@ def add_notification(self, notification: Notification): """ return self.repository.add_notification(notification) - def get_chat_notifications(self, chat_id: UUID) -> List[Notification]: - """ - Get notifications by chat_id - """ - return self.repository.get_notifications_by_chat_id(chat_id) - def update_notification_by_id( self, notification_id, notification: NotificationUpdatableProperties ):