diff --git a/src/session-user/session-user.controller.ts b/src/session-user/session-user.controller.ts index 45bbe594..8ea52d1f 100644 --- a/src/session-user/session-user.controller.ts +++ b/src/session-user/session-user.controller.ts @@ -1,7 +1,7 @@ import { Body, Controller, Post, Req, UseGuards } from '@nestjs/common'; import { ApiBearerAuth, ApiOperation, ApiTags } from '@nestjs/swagger'; import { Request } from 'express'; -import { GetUserDto } from 'src/user/dtos/get-user.dto'; +import {UserEntity} from '../entities/user.entity'; import { ControllerDecorator } from 'src/utils/controller.decorator'; import { FirebaseAuthGuard } from '../firebase/firebase-auth.guard'; import { UpdateSessionUserDto } from './dtos/update-session-user.dto'; @@ -22,7 +22,7 @@ export class SessionUserController { @UseGuards(FirebaseAuthGuard) async createSessionUser(@Req() req: Request, @Body() createSessionUserDto: UpdateSessionUserDto) { return await this.sessionUserService.createSessionUser( - req['user'] as GetUserDto, + req['userEntity'] as UserEntity, createSessionUserDto, ); } @@ -35,7 +35,7 @@ export class SessionUserController { @UseGuards(FirebaseAuthGuard) async complete(@Req() req: Request, @Body() updateSessionUserDto: UpdateSessionUserDto) { return await this.sessionUserService.setSessionUserCompleted( - req['user'] as GetUserDto, + req['userEntity'] as UserEntity, updateSessionUserDto, true, ); @@ -50,7 +50,7 @@ export class SessionUserController { @UseGuards(FirebaseAuthGuard) async incomplete(@Req() req: Request, @Body() updateSessionUserDto: UpdateSessionUserDto) { return await this.sessionUserService.setSessionUserCompleted( - req['user'] as GetUserDto, + req['userEntity'] as UserEntity, updateSessionUserDto, false, ); diff --git a/src/session-user/session-user.service.ts b/src/session-user/session-user.service.ts index 2c5ae6cc..70f5385a 100644 --- a/src/session-user/session-user.service.ts +++ b/src/session-user/session-user.service.ts @@ -10,7 +10,6 @@ import { CourseEntity } from '../entities/course.entity'; import { SessionUserEntity } from '../entities/session-user.entity'; import { Logger } from '../logger/logger'; import { SessionService } from '../session/session.service'; -import { GetUserDto } from '../user/dtos/get-user.dto'; import { STORYBLOK_STORY_STATUS_ENUM } from '../utils/constants'; import { formatCourseUserObject, formatCourseUserObjects } from '../utils/serialize'; import { SessionUserDto } from './dtos/session-user.dto'; @@ -86,7 +85,7 @@ export class SessionUserService { }); } - public async createSessionUser({ user }: GetUserDto, { storyblokId }: UpdateSessionUserDto) { + public async createSessionUser(user: UserEntity, { storyblokId }: UpdateSessionUserDto) { const session = await this.sessionService.getSessionByStoryblokId(storyblokId); if (!session) { @@ -132,7 +131,7 @@ export class SessionUserService { } public async setSessionUserCompleted( - { user }: GetUserDto, + user : UserEntity, { storyblokId }: UpdateSessionUserDto, completed: boolean, ) {