MCPcopy Create free account
hub / github.com/0010aor/FlashNotes / read_card

Function read_card

backend/src/flashcards/api.py:172–185  ·  view source on GitHub ↗
(
    session: SessionDep,
    current_user: CurrentUser,
    collection_id: uuid.UUID,
    card_id: uuid.UUID,
)

Source from the content-addressed store, hash-verified

170
171@router.get("/collections/{collection_id}/cards/{card_id}", response_model=Card)
172def read_card(
173 session: SessionDep,
174 current_user: CurrentUser,
175 collection_id: uuid.UUID,
176 card_id: uuid.UUID,
177) -> Any:
178 if not services.check_collection_access(session, collection_id, current_user.id):
179 raise HTTPException(status_code=404, detail="Collection not found")
180 card = services.get_card_with_collection(
181 session=session, card_id=card_id, user_id=current_user.id
182 )
183 if not card or card.collection_id != collection_id:
184 raise HTTPException(status_code=404, detail="Card not found")
185 return card
186
187
188@router.put("/collections/{collection_id}/cards/{card_id}", response_model=Card)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected