| 122 | |
| 123 | @router.get("/collections/{collection_id}/cards/", response_model=CardList) |
| 124 | def read_cards( |
| 125 | session: SessionDep, |
| 126 | current_user: CurrentUser, |
| 127 | collection_id: uuid.UUID, |
| 128 | skip: int = 0, |
| 129 | limit: int = 100, |
| 130 | ) -> Any: |
| 131 | if not services.check_collection_access(session, collection_id, current_user.id): |
| 132 | raise HTTPException(status_code=404, detail="Collection not found") |
| 133 | cards, count = services.get_cards( |
| 134 | session=session, collection_id=collection_id, skip=skip, limit=limit |
| 135 | ) |
| 136 | return CardList(data=cards, count=count) |
| 137 | |
| 138 | |
| 139 | @router.post("/collections/{collection_id}/cards/", response_model=Card) |