fix: rename event module into analytics and clean (#482)

This commit is contained in:
Jérémy M
2023-06-30 11:24:05 +02:00
committed by GitHub
parent 7893d5dba5
commit cca36cf50f
16 changed files with 75 additions and 104 deletions

View File

@ -0,0 +1,24 @@
import { Resolver, Mutation, Args } from '@nestjs/graphql';
import { AnalyticsService } from './analytics.service';
import { Analytics } from './analytics.entity';
import { CreateAnalyticsInput } from './dto/create-analytics.input';
import { OptionalJwtAuthGuard } from 'src/guards/optional-jwt.auth.guard';
import { UseGuards } from '@nestjs/common';
import { AuthWorkspace } from 'src/decorators/auth-workspace.decorator';
import { User, Workspace } from '@prisma/client';
import { AuthUser } from 'src/decorators/auth-user.decorator';
@UseGuards(OptionalJwtAuthGuard)
@Resolver(() => Analytics)
export class AnalyticsResolver {
constructor(private readonly analyticsService: AnalyticsService) {}
@Mutation(() => Analytics)
createEvent(
@Args() createEventInput: CreateAnalyticsInput,
@AuthWorkspace() workspace: Workspace | undefined,
@AuthUser() user: User | undefined,
) {
return this.analyticsService.create(createEventInput, user, workspace);
}
}