ci: attempt to fix ci scripts by not importing prisma as type

This commit is contained in:
Amruth Pillai
2023-11-24 01:48:14 +01:00
parent 12b52af121
commit a4843cf7e6
6 changed files with 28 additions and 7 deletions

View File

@ -8,7 +8,7 @@ import {
import { ConfigService } from "@nestjs/config";
import { JwtService } from "@nestjs/jwt";
import { PrismaClientKnownRequestError } from "@prisma/client/runtime/library";
import { AuthProvidersDto, LoginDto, RegisterDto } from "@reactive-resume/dto";
import { AuthProvidersDto, LoginDto, RegisterDto, UserWithSecrets } from "@reactive-resume/dto";
import { ErrorMessage } from "@reactive-resume/utils";
import * as bcryptjs from "bcryptjs";
import { randomBytes } from "crypto";
@ -110,7 +110,7 @@ export class AuthService {
// Do not `await` this function, otherwise the user will have to wait for the email to be sent before the response is returned
this.sendVerificationEmail(user.email);
return user;
return user as UserWithSecrets;
} catch (error) {
if (error instanceof PrismaClientKnownRequestError && error.code === "P2002") {
throw new BadRequestException(ErrorMessage.UserAlreadyExists);
@ -341,6 +341,6 @@ export class AuthService {
secrets: { update: { twoFactorBackupCodes: backupCodes } },
});
return user;
return user as UserWithSecrets;
}
}