Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

fix: restrict goals to the current project id

Blue Mousea08d281bb2b4
diff --git a/backend/apps/cloud/src/ai/ai.service.ts b/backend/apps/cloud/src/ai/ai.service.ts
index 1fae10b99..df9a1060c 100644
--- a/backend/apps/cloud/src/ai/ai.service.ts
+++ b/backend/apps/cloud/src/ai/ai.service.ts
@@ -1542,7 +1542,9 @@ Filter modifiers:
)
if (goalId) {
- const goal = await this.goalService.findOne({ where: { id: goalId } })
+ const goal = await this.goalService.findOne({
+ where: { id: goalId, project: { id: pid } },
+ })
if (!goal) {
return { error: 'Goal not found' }
}