1- import { accessibleQuery , InjectModel , LoggingService } from '@douglasneuroinformatics/libnest' ;
2- import type { Model } from '@douglasneuroinformatics/libnest' ;
1+ import { accessibleQuery , InjectModel , InjectPrismaClient , LoggingService } from '@douglasneuroinformatics/libnest' ;
2+ import type { ExtendedPrismaClient , Model } from '@douglasneuroinformatics/libnest' ;
33import { Injectable } from '@nestjs/common' ;
44import { InternalServerErrorException , NotFoundException } from '@nestjs/common/exceptions' ;
55import type { Group } from '@opendatacapture/schemas/group' ;
@@ -15,6 +15,7 @@ import { UsersService } from '@/users/users.service';
1515@Injectable ( )
1616export class SessionsService {
1717 constructor (
18+ @InjectPrismaClient ( ) private readonly prismaClient : ExtendedPrismaClient ,
1819 @InjectModel ( 'Session' ) private readonly sessionModel : Model < 'Session' > ,
1920 private readonly groupsService : GroupsService ,
2021 private readonly loggingService : LoggingService ,
@@ -35,7 +36,12 @@ export class SessionsService {
3536 let user : null | Omit < User , 'hashedPassword' > = null ;
3637
3738 if ( userId ) {
38- user = await this . userService . findById ( userId ) ;
39+ user = await this . prismaClient . user . findUnique ( {
40+ where : {
41+ username : userId
42+ }
43+ } ) ;
44+ // user = await this.userService.findById(userId);
3945 }
4046
4147 // If the subject is not yet associated with the group, check it exists then append it
0 commit comments