def create_collection( *, _: bool = Depends(is_authenticated), repository: CollectionRepository = Depends(get_collection_repository), collection: CollectionUpdate): db_collection: DBCollection = DBCollection(**collection.dict()) return repository.add(db_collection)
def create_collection( *, _: bool = Depends(is_authenticated), repository: CollectionRepository = Depends(get_collection_repository), collection: CollectionUpdate, ): db_collection: DBCollection = repository.add( DBCollection.create(collection)) return db_collection.to_model()