We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 13f55cb commit 1e02b55Copy full SHA for 1e02b55
cognition_objects/integration_access.py
@@ -36,12 +36,15 @@ def get(
36
return query.order_by(CognitionIntegrationAccess.created_at.asc()).all()
37
38
39
-def get_all() -> List[CognitionIntegrationAccess]:
40
- return (
41
- session.query(CognitionIntegrationAccess)
42
- .order_by(CognitionIntegrationAccess.created_at.desc())
43
- .all()
44
- )
+def get_all(
+ integration_type: Optional[CognitionIntegrationType] = None,
+) -> List[CognitionIntegrationAccess]:
+ query = session.query(CognitionIntegrationAccess)
+ if integration_type:
+ query = query.filter(
45
+ CognitionIntegrationAccess.integration_type == integration_type.value
46
+ )
47
+ return query.order_by(CognitionIntegrationAccess.created_at.desc()).all()
48
49
50
def create(
0 commit comments