Skip to content

Commit 5740581

Browse files
committed
Lint fixes
1 parent 23ee4f7 commit 5740581

File tree

15 files changed

+40
-57
lines changed

15 files changed

+40
-57
lines changed

server/src/app.module.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Logger, Module } from '@nestjs/common';
22
import { ConfigModule, ConfigService } from '@nestjs/config';
33
import { MongooseModule, MongooseModuleFactoryOptions } from '@nestjs/mongoose';
4+
import { ThrottlerModule } from '@nestjs/throttler';
45
import { MailerModule } from '@nestjs-modules/mailer';
56
import { HandlebarsAdapter } from '@nestjs-modules/mailer/dist/adapters/handlebars.adapter';
67

@@ -14,7 +15,6 @@ import { SeedModule } from './seed/seed.module';
1415
import { SongModule } from './song/song.module';
1516
import { SongBrowserModule } from './song-browser/song-browser.module';
1617
import { UserModule } from './user/user.module';
17-
import { ThrottlerModule } from '@nestjs/throttler';
1818

1919
@Module({
2020
imports: [
@@ -86,6 +86,18 @@ import { ThrottlerModule } from '@nestjs/throttler';
8686
ttl: 60 * 60 * 100, // 1 hour
8787
limit: 1000,
8888
},
89+
// one every 15 minutes
90+
{
91+
name: 'very-long',
92+
ttl: 15 * 60 * 1000,
93+
limit: 1,
94+
},
95+
// one every 1 hour
96+
{
97+
name: 'super-long',
98+
ttl: 60 * 60 * 1000,
99+
limit: 1,
100+
},
89101
]),
90102
SongModule,
91103
UserModule,

server/src/auth/strategies/magicLinkEmail.strategy.spec.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import { ConfigService } from '@nestjs/config';
22
import { Test, TestingModule } from '@nestjs/testing';
3+
34
import { MailingService } from '@server/mailing/mailing.service';
45
import { UserService } from '@server/user/user.service';
6+
57
import { MagicLinkEmailStrategy } from './magicLinkEmail.strategy';
68

79
describe('MagicLinkEmailStrategy', () => {
@@ -144,6 +146,7 @@ describe('MagicLinkEmailStrategy', () => {
144146
expect(loggerSpy).toHaveBeenCalledWith(
145147
'User not found: [email protected]',
146148
);
149+
147150
expect(result).toBeNull();
148151
});
149152
});

server/src/config/EnvironmentVariables.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
import { plainToInstance } from 'class-transformer';
2-
import {
3-
IsEnum,
4-
IsNotEmpty,
5-
IsOptional,
6-
IsString,
7-
validateSync,
8-
} from 'class-validator';
2+
import { IsEnum, IsOptional, IsString, validateSync } from 'class-validator';
93

104
enum Environment {
115
Development = 'development',

server/src/user/user.controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ import { Body, Controller, Get, Inject, Patch, Query } from '@nestjs/common';
22
import { ApiBearerAuth, ApiOperation, ApiTags } from '@nestjs/swagger';
33
import { PageQueryDTO } from '@shared/validation/common/dto/PageQuery.dto';
44
import { GetUser } from '@shared/validation/user/dto/GetUser.dto';
5+
import { UpdateUsernameDto } from '@shared/validation/user/dto/UpdateUsername.dto';
56

67
import { GetRequestToken, validateUser } from '@server/GetRequestUser';
78

89
import { UserDocument } from './entity/user.entity';
910
import { UserService } from './user.service';
10-
import { UpdateUsernameDto } from '@shared/validation/user/dto/UpdateUsername.dto';
1111

1212
@Controller('user')
1313
export class UserController {

server/src/user/user.service.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,7 @@ describe('UserService', () => {
332332
username: 'testuser',
333333
save: jest.fn().mockReturnThis(),
334334
} as unknown as UserDocument;
335+
335336
const body = { username: 'newuser' };
336337

337338
jest.spyOn(service, 'usernameExists').mockResolvedValue(false);

server/src/user/user.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import { InjectModel } from '@nestjs/mongoose';
33
import { PageQueryDTO } from '@shared/validation/common/dto/PageQuery.dto';
44
import { CreateUser } from '@shared/validation/user/dto/CreateUser.dto';
55
import { GetUser } from '@shared/validation/user/dto/GetUser.dto';
6-
import { NewEmailUserDto } from '@shared/validation/user/dto/NewEmailUser.dto';
6+
import { UpdateUsernameDto } from '@shared/validation/user/dto/UpdateUsername.dto';
77
import { validate } from 'class-validator';
88
import { Model } from 'mongoose';
9-
import { UpdateUsernameDto } from '@shared/validation/user/dto/UpdateUsername.dto';
9+
1010
import { User, UserDocument } from './entity/user.entity';
1111

1212
@Injectable()

web/src/lib/axios/ClientAxios.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import axios from 'axios';
2+
23
import { getTokenLocal } from './token.utils';
4+
35
export const baseApiURL = process.env.NEXT_PUBLIC_API_URL;
46

57
const ClientAxios = axios.create({

web/src/modules/auth/components/RegistrationPage.tsx

Lines changed: 0 additions & 28 deletions
This file was deleted.

web/src/modules/auth/components/client/LoginFrom.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
'use client';
22
import { faExclamationCircle } from '@fortawesome/free-solid-svg-icons';
33
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
4+
import axios from 'axios';
45
import Link from 'next/link';
5-
import { useRouter } from 'next/navigation';
66
import { FC, useState } from 'react';
77
import { useForm } from 'react-hook-form';
88

99
import { ErrorBalloon } from '@web/src/modules/shared/components/client/ErrorBalloon';
1010

11-
import axios from 'axios';
12-
1311
import {
1412
Input,
1513
SubmitButton,
@@ -24,16 +22,14 @@ const backendURL = process.env.NEXT_PUBLIC_API_URL;
2422
// TODO: Implement login logic
2523
export const LoginForm: FC = () => {
2624
const [isLoading, setIsLoading] = useState(false);
27-
const [isLocked, setIsLocked] = useState(false);
25+
const [isLocked] = useState(false);
2826

2927
const {
3028
register,
3129
handleSubmit,
3230
formState: { errors },
3331
} = useForm<LoginFormData>();
3432

35-
const router = useRouter();
36-
3733
const onSubmit = async ({ email }: LoginFormData) => {
3834
try {
3935
setIsLoading(true);

web/src/modules/my-songs/components/client/context/MySongs.context.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
useEffect,
1414
useState,
1515
} from 'react';
16-
import toast from 'react-hot-toast';
16+
import { toast } from 'react-hot-toast';
1717

1818
import axiosInstance from '@web/src/lib/axios';
1919
import { getTokenLocal } from '@web/src/lib/axios/token.utils';

0 commit comments

Comments
 (0)