Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | import { Injectable } from '@nestjs/common'; import { UserSessionRepository } from 'src/modules/common/database/mongo/auth/repositories/user-session.repository'; import { IWithMongoId } from 'src/modules/common/database/mongo/shared/mongo.interface'; import { TPartialBy } from 'src/shared/interface'; import { IUserSession } from '../shared/user-session.interface'; @Injectable() export class UserSessionService { constructor(private readonly userSessionRepository: UserSessionRepository) {} async captureLatestSession( input: TPartialBy<IUserSession, 'isDeleted' | 'createdAt' | 'updatedAt'> & IWithMongoId, ) { await this.userSessionRepository.invalidateAll(); return this.userSessionRepository.create(input); } } |