(
session: SessionDep,
current_user: CurrentUser,
collection_id: uuid.UUID,
card_id: uuid.UUID,
card_in: CardUpdate,
)
| 187 | |
| 188 | @router.put("/collections/{collection_id}/cards/{card_id}", response_model=Card) |
| 189 | def update_card( |
| 190 | session: SessionDep, |
| 191 | current_user: CurrentUser, |
| 192 | collection_id: uuid.UUID, |
| 193 | card_id: uuid.UUID, |
| 194 | card_in: CardUpdate, |
| 195 | ) -> Any: |
| 196 | if not services.check_collection_access(session, collection_id, current_user.id): |
| 197 | raise HTTPException(status_code=404, detail="Collection not found") |
| 198 | card = services.get_card_with_collection( |
| 199 | session=session, card_id=card_id, user_id=current_user.id |
| 200 | ) |
| 201 | if not card or card.collection_id != collection_id: |
| 202 | raise HTTPException(status_code=404, detail="Card not found") |
| 203 | return services.update_card(session=session, card=card, card_in=card_in) |
| 204 | |
| 205 | |
| 206 | @router.delete("/collections/{collection_id}/cards/{card_id}", status_code=204) |
nothing calls this directly
no outgoing calls
no test coverage detected