Fix analytics (#7271)

Incorrect check
This commit is contained in:
Félix Malfait 2024-09-26 16:42:16 +02:00 committed by GitHub
parent 0e375d9021
commit a10324cbd3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 5 deletions

View File

@ -1,6 +1,4 @@
import { Args, Context, Mutation, Resolver } from '@nestjs/graphql'; import { Args, Mutation, Resolver } from '@nestjs/graphql';
import { Request } from 'express';
import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service'; import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service';
import { User } from 'src/engine/core-modules/user/user.entity'; import { User } from 'src/engine/core-modules/user/user.entity';
@ -25,7 +23,6 @@ export class AnalyticsResolver {
@Args() createAnalyticsInput: CreateAnalyticsInput, @Args() createAnalyticsInput: CreateAnalyticsInput,
@AuthWorkspace() workspace: Workspace | undefined, @AuthWorkspace() workspace: Workspace | undefined,
@AuthUser({ allowUndefined: true }) user: User | undefined, @AuthUser({ allowUndefined: true }) user: User | undefined,
@Context('req') request: Request,
) { ) {
return this.analyticsService.create( return this.analyticsService.create(
createAnalyticsInput, createAnalyticsInput,

View File

@ -25,7 +25,7 @@ export class AnalyticsService {
userId: string | null | undefined, userId: string | null | undefined,
workspaceId: string | null | undefined, workspaceId: string | null | undefined,
) { ) {
if (this.environmentService.get('ANALYTICS_ENABLED')) { if (!this.environmentService.get('ANALYTICS_ENABLED')) {
return { success: true }; return { success: true };
} }