diff --git a/trpc/router/goal.ts b/trpc/router/goal.ts index b74061858..12c83b5a1 100644 --- a/trpc/router/goal.ts +++ b/trpc/router/goal.ts @@ -287,9 +287,7 @@ export const goal = router({ }, }, }), - prisma.goal.findMany<{ - include: typeof goalDeepQuery; - }>({ + prisma.goal.findMany({ ...goalsFilter(input, ctx.session.user.activityId, { ...userDashboardGoals, }), diff --git a/trpc/router/project.ts b/trpc/router/project.ts index f2f492a0f..bf181d452 100644 --- a/trpc/router/project.ts +++ b/trpc/router/project.ts @@ -213,7 +213,7 @@ export const project = router({ }, }, }), - prisma.goal.findMany<{ include: typeof goalDeepQuery }>({ + prisma.goal.findMany({ ...goalsFilter(input, ctx.session.user.activityId, { AND: { OR: [ @@ -249,7 +249,7 @@ export const project = router({ return { goals: filtredProjectGoals.map((g) => ({ ...g, - project: g.project ? addCalculatedProjectFields(g.project, ctx.session.user.activityId) : g.project, + project: g.project ? addCalculatedProjectFields(g.project, ctx.session.user.activityId) : null, ...addCalclulatedGoalsFields(g, ctx.session.user.activityId), estimate: getEstimateListFormJoin(g), })),