Files
FACULTATE-MESSENGER/messenger_app/api/v1/endpoints/messages/get_conversation.py
T

10 lines
365 B
Python

from fastapi import HTTPException, status
from database.queries.messages import find_conversation_db
async def get_conversation(conversation_url: str):
conversation = find_conversation_db(conversation_url)
if conversation is None:
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="Conversation not found")
return conversation