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

Function update_collection

backend/src/flashcards/api.py:94–107  ·  view source on GitHub ↗
(
    session: SessionDep,
    current_user: CurrentUser,
    collection_id: uuid.UUID,
    collection_in: CollectionUpdate,
)

Source from the content-addressed store, hash-verified

92
93@router.put("/collections/{collection_id}", response_model=Collection)
94def update_collection(
95 session: SessionDep,
96 current_user: CurrentUser,
97 collection_id: uuid.UUID,
98 collection_in: CollectionUpdate,
99) -> Any:
100 collection = services.get_collection(
101 session=session, id=collection_id, user_id=current_user.id
102 )
103 if not collection:
104 raise HTTPException(status_code=404, detail="Collection not found")
105 return services.update_collection(
106 session=session, collection=collection, collection_in=collection_in
107 )
108
109
110@router.delete("/collections/{collection_id}", status_code=204)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected