Skip to content

Commit

Permalink
style: fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuhanming committed Nov 24, 2023
1 parent c94065b commit 2be2323
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/product/general/interviews/interviews.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export class InterviewsService {
where: { id, isValid: true, roomRecordUsers: { some: { userId } } },
include: { roomRecordUsers: { include: { user: true } }, room: true },
});
if (roomRecord == null || roomRecord.room.closedAt == null) {
if (roomRecord?.room.closedAt == null) {
this.logger.error(
'Invalid interview accessed',
undefined,
Expand Down
2 changes: 0 additions & 2 deletions src/product/interfaces/interviews.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ export const makeInterviewListItem = (
): InterviewListItem => {
return {
...makeInterviewBase(roomRecord, userId),
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
completedAt: roomRecord.room.closedAt!,
duration: roomRecord.duration,
language: roomRecord.language,
Expand Down Expand Up @@ -100,7 +99,6 @@ export const makeInterviewItem = (
(roomRecordUser) => roomRecordUser.userId !== userId,
)[0];
return {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
completedAt: roomRecord.room.closedAt!,
partner: {
name: partnerRoomRecordUser.user.name,
Expand Down
5 changes: 2 additions & 3 deletions src/productinfra/judge0/judge0.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,8 @@ export class Judge0Service {
}
const keys = Array(...this.prismaLanguageToJudge0Language.keys());
// They will all have the same lastUpdated, so we'll just check any one
const lastUpdated = this.prismaLanguageToJudge0Language.get(
keys[0],
)?.lastUpdated;
const lastUpdated = this.prismaLanguageToJudge0Language.get(keys[0])
?.lastUpdated;
if (lastUpdated && Date.now() - lastUpdated > VERSION_UPDATE_INTERVAL_MS) {
return this.refreshLanguages();
}
Expand Down
5 changes: 4 additions & 1 deletion src/productinfra/strategies/jwt-rest-admin.strategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ export class JwtRestAdminStrategy extends PassportStrategy(
Strategy,
'jwt-rest-admin',
) {
constructor(config: ConfigService, private prisma: PrismaService) {
constructor(
config: ConfigService,
private prisma: PrismaService,
) {
super({
jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(),
secretOrKey: config.get('JWT_SECRET'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ export class JwtRestStudentOrAdminStrategy extends PassportStrategy(
Strategy,
'jwt-rest-student-or-admin',
) {
constructor(config: ConfigService, private prisma: PrismaService) {
constructor(
config: ConfigService,
private prisma: PrismaService,
) {
super({
jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(),
secretOrKey: config.get('JWT_SECRET'),
Expand Down
5 changes: 4 additions & 1 deletion src/productinfra/strategies/jwt-rest.strategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ import { PrismaService } from '../../infra/prisma/prisma.service';

@Injectable()
export class JwtRestStrategy extends PassportStrategy(Strategy, 'jwt-rest') {
constructor(config: ConfigService, private prisma: PrismaService) {
constructor(
config: ConfigService,
private prisma: PrismaService,
) {
super({
jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(),
secretOrKey: config.get('JWT_SECRET'),
Expand Down

0 comments on commit 2be2323

Please sign in to comment.