Skip to content

Commit

Permalink
Added delete conversation
Browse files Browse the repository at this point in the history
  • Loading branch information
lukas-holzner committed Sep 30, 2024
1 parent 72d4f14 commit 3435638
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions backend/app/routers/meetings.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,14 @@ def create_conversation(meeting_id: int, user_id: int, db: Session = Depends(get
def router_add_message(meeting_id: int, user_id: int, message: str, db: Session = Depends(get_db)):
return add_message(db, meeting_id=meeting_id, user_id=user_id, message=ChatMessage(message=message, author="user", timestamp=datetime.now()))

@router.delete("/meetings/{meeting_id}/{user_id}/conversation", response_model=schemas.Conversation)
def delete_conversation(meeting_id: int, user_id: int, db: Session = Depends(get_db)):
db_conversation = get_conversation(db, meeting_id=meeting_id, user_id=user_id)
if db_conversation is None:
raise HTTPException(status_code=404, detail="Conversation not found")
db.delete(db_conversation)
db.commit()
return db_conversation



2 changes: 1 addition & 1 deletion test/init_db.bash
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/bash

# Set the base URL
#BASE_URL="https://codefusion.lholz.de"
BASE_URL="http://127.0.0.1:8000"

# Function to make a POST request
make_post_request() {
local endpoint=$1
Expand Down

0 comments on commit 3435638

Please sign in to comment.