fix(insights): skip sprints with null completed_at in velocity
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
a754acf13b
commit
b2427fd07b
1 changed files with 2 additions and 2 deletions
|
|
@ -33,7 +33,7 @@ export async function getVelocity(userId: string, sprintsBack = 5): Promise<Velo
|
|||
})
|
||||
|
||||
// Reverse to chronological order (oldest first, for x-axis)
|
||||
const chronological = [...sprints].reverse()
|
||||
const chronological = [...sprints].filter(s => s.completed_at != null).reverse()
|
||||
|
||||
const result: VelocitySprint[] = chronological.map(sprint => ({
|
||||
sprintId: sprint.id,
|
||||
|
|
@ -41,7 +41,7 @@ export async function getVelocity(userId: string, sprintsBack = 5): Promise<Velo
|
|||
productId: sprint.product.id,
|
||||
productName: sprint.product.name,
|
||||
doneCount: sprint.tasks.filter(t => t.status === 'DONE').length,
|
||||
completedAt: sprint.completed_at!.toISOString(),
|
||||
completedAt: sprint.completed_at.toISOString(),
|
||||
}))
|
||||
|
||||
const seen = new Set<string>()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue