Skip to content

Commit

Permalink
fix: Refactor chat_service.py and remove unused code (#2530)
Browse files Browse the repository at this point in the history
# 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):
  • Loading branch information
StanGirard committed May 1, 2024
1 parent 41baace commit 62bfc3c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
2 changes: 1 addition & 1 deletion backend/modules/chat/service/chat_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand Down
9 changes: 0 additions & 9 deletions backend/modules/notification/service/notification_service.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
):
Expand Down

0 comments on commit 62bfc3c

Please sign in to comment.