Skip to content

Commit

Permalink
fix: limit and offset
Browse files Browse the repository at this point in the history
  • Loading branch information
talboren authored and VladimirFilonov committed Oct 31, 2024
1 parent 72ed487 commit 9ca42db
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion keep/api/core/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -3208,6 +3208,7 @@ def get_incident_alerts_and_links_by_incident_id(
Incident.id == incident_id,
)
.order_by(col(Alert.timestamp).desc())
.options(joinedload(Alert.alert_enrichment))
)
if not include_unlinked:
query = query.filter(
Expand All @@ -3216,7 +3217,7 @@ def get_incident_alerts_and_links_by_incident_id(

total_count = query.count()

if limit and offset:
if limit is not None and offset is not None:
query = query.limit(limit).offset(offset)

return query.all(), total_count
Expand Down

0 comments on commit 9ca42db

Please sign in to comment.