Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions api/routers/journal_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,18 @@ async def get_entry(request: Request, entry_id: str, entry_service: EntryService
TODO: Implement this endpoint to return a single journal entry by ID

Steps to implement:
1. Use the entry_service to get the entry by ID
2. Return 404 if entry not found
3. Return the entry as JSON if found

Hint: Check the update_entry endpoint for similar patterns
"""
"""
# 1. Use the entry_service to get the entry by ID
entry = await entry_service.get_entry(entry_id)

# 2. Return 404 if entry not found
if entry is None:
raise HTTPException(status_code=404, detail=f"Entry with ID {entry_id} not found")

# 3. Return the entry as JSON if found
return entry

# Hint: Check the update_entry endpoint for similar patterns
raise HTTPException(status_code=501, detail="Not implemented - complete this endpoint!")

@router.patch("/entries/{entry_id}")
Expand Down