fix: get correct task

This commit is contained in:
2025-01-11 18:51:43 +01:00
parent 3c32d01c48
commit af9cc928a7

View File

@@ -1,7 +1,8 @@
import { db } from "$lib/db" import { db } from "$lib/db"
import { tasksToTopics } from "$lib/db/schema" import { tasks, tasksToTopics } from "$lib/db/schema"
import { eq } from "drizzle-orm"
export const load = async () => { export const load = async ({ params }) => {
return { return {
task: (await db.query.tasks.findFirst({ task: (await db.query.tasks.findFirst({
with: { with: {
@@ -10,7 +11,9 @@ export const load = async () => {
topic: true topic: true
} }
} }
} },
where: eq(tasks.id, params.id)
}) })
), ),
topics: await db.query.topics.findMany() topics: await db.query.topics.findMany()