Skip to content

Commit b08d467

Browse files
committed
fix: resolve eslint problems
1 parent 16184be commit b08d467

File tree

11 files changed

+21
-31
lines changed

11 files changed

+21
-31
lines changed

api/src/__mocks__/user.stub.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { EmailConfirm, RefreshToken, User } from "@prisma/client";
1+
import { EmailConfirm, RefreshToken, User } from '@prisma/client';
22

33
export function getUserStub(): User & {
44
refreshToken: RefreshToken | null;
@@ -13,4 +13,4 @@ export function getUserStub(): User & {
1313
refreshToken: null,
1414
emailConfirm: null,
1515
};
16-
}
16+
}

api/src/controllers/auth/__tests__/auth.controller.spec.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ describe('AuthController', () => {
2626
Prisma: DeepMocked<DatabaseServiceProvider['Prisma']>;
2727
};
2828
let authService: DeepMocked<AuthServiceProvider>;
29-
let tokenService: DeepMocked<TokenServiceProvider>;
3029

3130
beforeAll(async () => {
3231
const dbMock = createMock<DeepMocked<DatabaseServiceProvider['Prisma']>>();
@@ -69,7 +68,7 @@ describe('AuthController', () => {
6968
},
7069
{
7170
provide: TokenServiceProvider,
72-
useValue: createMock<TokenServiceProvider>()
71+
useValue: createMock<TokenServiceProvider>(),
7372
},
7473
JwtStrategy,
7574
JwtRefreshTokenStrategy,
@@ -81,10 +80,7 @@ describe('AuthController', () => {
8180

8281
appWrap.app = module.createNestApplication();
8382
appWrap.app.useGlobalInterceptors(
84-
new HttpInterceptor(
85-
createMock<ModuleRef>(),
86-
db as unknown as DatabaseServiceProvider,
87-
),
83+
new HttpInterceptor(createMock<ModuleRef>(), db as unknown as DatabaseServiceProvider),
8884
);
8985
appWrap.app.use(cookieParser());
9086
await appWrap.app.init();
@@ -151,7 +147,11 @@ describe('AuthController', () => {
151147
});
152148

153149
it('should return valid response', async () => {
154-
authService.signIn.mockResolvedValueOnce({ accessToken: '1', refreshCookie: '2', refreshToken: '2' });
150+
authService.signIn.mockResolvedValueOnce({
151+
accessToken: '1',
152+
refreshCookie: '2',
153+
refreshToken: '2',
154+
});
155155
const response = await request(appWrap.app.getHttpServer())
156156
.post('/api/auth/sign-in')
157157
.set('Content-Type', 'application/x-www-form-urlencoded')

api/src/controllers/auth/auth.controller.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,15 @@ import { User } from '../../core/controller.core';
55
import { AuthService, AuthServiceProvider } from '../../services/auth/auth.service';
66
import { UseValidationPipe } from '../../utils/validation.utils';
77
import { ConfirmEmailInput, SignInInput, SignUpInput } from './auth.model';
8-
import { JwtUserRefreshGuard } from '../../services/auth/guards/jwt-user-refresh.guard'
8+
import { JwtUserRefreshGuard } from '../../services/auth/guards/jwt-user-refresh.guard';
99
import { UserType } from '../../services/token/token.model';
1010

1111
@Controller('api/auth')
1212
export class AuthControllerProvider {
13-
constructor(private authService: AuthServiceProvider, private tokenService: TokenServiceProvider) {}
13+
constructor(
14+
private authService: AuthServiceProvider,
15+
private tokenService: TokenServiceProvider,
16+
) {}
1417

1518
@Post('sign-up')
1619
@UseValidationPipe()

api/src/controllers/auth/auth.model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ export class SignInInput {
2323
export class ConfirmEmailInput {
2424
@IsString() //TODO: replace validate string for UUID
2525
confirmUuid: string;
26-
}
26+
}

api/src/controllers/user/__tests__/user.controller.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ describe('UserController', () => {
7272
JwtRefreshTokenStrategy,
7373
],
7474
controllers: [UserControllerProvider],
75-
})
76-
.compile();
75+
}).compile();
7776

7877
db = module.get(DatabaseServiceProvider);
7978
userService = module.get(UserServiceProvider);

api/src/controllers/user/user.controller.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ import { UserService, UserServiceProvider } from '../../services/user/user.servi
66

77
@Controller('api/user')
88
export class UserControllerProvider {
9-
constructor(
10-
private users: UserServiceProvider,
11-
) {}
9+
constructor(private users: UserServiceProvider) {}
1210

1311
@Get('me')
1412
@UseGuards(JwtUserGuard)

api/src/controllers/user/user.model.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
import { Transform, plainToClass, Type } from 'class-transformer';
22
import { IsOptional, ValidateNested } from 'class-validator';
3-
import {
4-
CompareNumberQuery,
5-
CompareDateQuery,
6-
IsSafeInteger,
7-
} from '../../utils/validation.utils';
3+
import { CompareNumberQuery, CompareDateQuery, IsSafeInteger } from '../../utils/validation.utils';
84

95
export class QueryParams {
106
@IsOptional()

api/src/services/auth/__tests__/auth.service.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import {
1616
CannotFindEmailConfirm,
1717
CannotFindUser,
1818
} from '../../../repositories/repositoryErrors.model';
19-
import { date } from '../../../utils';
2019
import { TokenServiceProvider } from '../../token/token.service';
2120
import { EmailConfirm } from '@prisma/client';
2221
import { getConfirmEmailStub } from '../../../__mocks__/confirmEmail.stub';

api/src/services/auth/auth.service.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { TokenService, TokenServiceProvider } from './../token/token.service';
22
import { JwtRefreshTokenStrategy } from './strategies/jwt-refresh.strategy';
3-
import { sha256 } from '../../utils/crypt.utils';
43
import { Injectable, Module } from '@nestjs/common';
5-
import { JwtModule, JwtService } from '@nestjs/jwt';
64
import { isError } from '../../core/errors.core';
75
import {
86
EmailConfirmsRepository,
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { User } from '@prisma/client';
2-
31
export enum UserType {
42
USER = 'user',
53
}

0 commit comments

Comments
 (0)