From f2078a6164c6ff6a14e398ad3724d7fa9a4e533c Mon Sep 17 00:00:00 2001 From: Maina Wycliffe Date: Fri, 11 Oct 2024 21:39:19 +0300 Subject: [PATCH] fix: fix playbook runs with pending status missing in the list Fixes #2305 --- src/api/services/playbooks.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/api/services/playbooks.ts b/src/api/services/playbooks.ts index 6e93279e1..d304391c6 100644 --- a/src/api/services/playbooks.ts +++ b/src/api/services/playbooks.ts @@ -179,6 +179,13 @@ export async function getPlaybookRuns({ searchParams.append("offset", (pageIndex * pageSize).toString()); searchParams.append("order", "created_at.desc"); + if (starts && ends) { + searchParams.append( + "or", + `(and(start_time.gte.${starts},start_time.lte.${ends}),and(created_at.gte.${starts},created_at.lte.${ends}))` + ); + } + if (playbookId) { searchParams.append("playbook_id", `eq.${playbookId}`); }