Skip to content

Commit c84e862

Browse files
committed
fix(analytics): always fire scheduled_task_deleted regardless of workspaceId
1 parent 7ecfd2c commit c84e862

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

apps/sim/app/api/schedules/[id]/route.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -299,14 +299,12 @@ export async function DELETE(
299299
request,
300300
})
301301

302-
if (workspaceId) {
303-
captureServerEvent(
304-
session.user.id,
305-
'scheduled_task_deleted',
306-
{ workspace_id: workspaceId },
307-
{ groups: { workspace: workspaceId } }
308-
)
309-
}
302+
captureServerEvent(
303+
session.user.id,
304+
'scheduled_task_deleted',
305+
{ workspace_id: workspaceId ?? '' },
306+
workspaceId ? { groups: { workspace: workspaceId } } : undefined
307+
)
310308

311309
return NextResponse.json({ message: 'Schedule deleted successfully' })
312310
} catch (error) {

0 commit comments

Comments
 (0)