diff --git a/actions/stories.ts b/actions/stories.ts
index 1495f4d..29119ae 100644
--- a/actions/stories.ts
+++ b/actions/stories.ts
@@ -223,6 +223,7 @@ export async function claimStoryAction(storyId: string, productId: string) {
await prisma.story.update({ where: { id: storyId }, data: { assignee_id: session.userId } })
revalidatePath(`/products/${productId}/sprint`)
+ revalidatePath(`/products/${productId}/solo`)
revalidatePath('/solo')
return { success: true }
}
diff --git a/app/(app)/products/[id]/solo/page.tsx b/app/(app)/products/[id]/solo/page.tsx
index e88773c..e402301 100644
--- a/app/(app)/products/[id]/solo/page.tsx
+++ b/app/(app)/products/[id]/solo/page.tsx
@@ -6,6 +6,7 @@ import { prisma } from '@/lib/prisma'
import { SoloBoard } from '@/components/solo/solo-board'
import { NoActiveSprint } from '@/components/solo/no-active-sprint'
import type { SoloTask } from '@/components/solo/solo-board'
+import type { UnassignedStory } from '@/components/solo/unassigned-stories-sheet'
interface Props {
params: Promise<{ id: string }>
@@ -33,7 +34,7 @@ export default async function SoloProductPage({ params }: Props) {
)
}
- const [rawTasks, unassignedCount] = await Promise.all([
+ const [rawTasks, rawUnassigned] = await Promise.all([
prisma.task.findMany({
where: {
story: {
@@ -50,8 +51,14 @@ export default async function SoloProductPage({ params }: Props) {
{ sort_order: 'asc' },
],
}),
- prisma.story.count({
+ prisma.story.findMany({
where: { sprint_id: sprint.id, assignee_id: null },
+ select: {
+ id: true,
+ title: true,
+ _count: { select: { tasks: true } },
+ },
+ orderBy: { sort_order: 'asc' },
}),
])
@@ -67,13 +74,19 @@ export default async function SoloProductPage({ params }: Props) {
story_title: t.story.title,
}))
+ const unassignedStories: UnassignedStory[] = rawUnassigned.map(s => ({
+ id: s.id,
+ title: s.title,
+ task_count: s._count.tasks,
+ }))
+
return (
{story.title}
++ {story.task_count} {story.task_count === 1 ? 'taak' : 'taken'} +
++ Geen ongeclaimde stories. Lekker bezig! +
+