From a10324cbd3e5204eb783ef9cbe2d75b5b41ca615 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Malfait?= Date: Thu, 26 Sep 2024 16:42:16 +0200 Subject: [PATCH] Fix analytics (#7271) Incorrect check --- .../src/engine/core-modules/analytics/analytics.resolver.ts | 5 +---- .../src/engine/core-modules/analytics/analytics.service.ts | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/twenty-server/src/engine/core-modules/analytics/analytics.resolver.ts b/packages/twenty-server/src/engine/core-modules/analytics/analytics.resolver.ts index f64d108fcd..71e76f8bd8 100644 --- a/packages/twenty-server/src/engine/core-modules/analytics/analytics.resolver.ts +++ b/packages/twenty-server/src/engine/core-modules/analytics/analytics.resolver.ts @@ -1,6 +1,4 @@ -import { Args, Context, Mutation, Resolver } from '@nestjs/graphql'; - -import { Request } from 'express'; +import { Args, Mutation, Resolver } from '@nestjs/graphql'; import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service'; import { User } from 'src/engine/core-modules/user/user.entity'; @@ -25,7 +23,6 @@ export class AnalyticsResolver { @Args() createAnalyticsInput: CreateAnalyticsInput, @AuthWorkspace() workspace: Workspace | undefined, @AuthUser({ allowUndefined: true }) user: User | undefined, - @Context('req') request: Request, ) { return this.analyticsService.create( createAnalyticsInput, diff --git a/packages/twenty-server/src/engine/core-modules/analytics/analytics.service.ts b/packages/twenty-server/src/engine/core-modules/analytics/analytics.service.ts index 3e8ca56d22..4e60ee74aa 100644 --- a/packages/twenty-server/src/engine/core-modules/analytics/analytics.service.ts +++ b/packages/twenty-server/src/engine/core-modules/analytics/analytics.service.ts @@ -25,7 +25,7 @@ export class AnalyticsService { userId: string | null | undefined, workspaceId: string | null | undefined, ) { - if (this.environmentService.get('ANALYTICS_ENABLED')) { + if (!this.environmentService.get('ANALYTICS_ENABLED')) { return { success: true }; }