fix: get correct task
This commit is contained in:
@@ -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()
|
||||||
|
|||||||
Reference in New Issue
Block a user