Skip to content

Commit

Permalink
refactor: 🎨 refactor code
Browse files Browse the repository at this point in the history
  • Loading branch information
Shchepotin committed Feb 18, 2021
1 parent 7e62c94 commit 86fa3ec
Show file tree
Hide file tree
Showing 27 changed files with 110 additions and 67 deletions.
5 changes: 5 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,10 @@ module.exports = {
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 2,
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': ['error'],
'require-await': 'off',
'@typescript-eslint/require-await': 'error',
'@typescript-eslint/no-floating-promises': 'error',
},
};
1 change: 1 addition & 0 deletions env-example
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ DATABASE_USERNAME=root
DATABASE_PASSWORD=secret
DATABASE_NAME=api
DATABASE_SYNCHRONIZE=false
DATABASE_MAX_CONNECTIONS=100

# Support "local", "s3"
FILE_DRIVER=local
Expand Down
105 changes: 70 additions & 35 deletions migrations/1604164774154-CreateUser.ts
Original file line number Diff line number Diff line change
@@ -1,40 +1,75 @@
import {MigrationInterface, QueryRunner} from "typeorm";
import { MigrationInterface, QueryRunner } from 'typeorm';

export class CreateUser1604164774154 implements MigrationInterface {
name = 'CreateUser1604164774154'
name = 'CreateUser1604164774154';

public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`CREATE TABLE "file" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "path" character varying NOT NULL, CONSTRAINT "PK_36b46d232307066b3a2c9ea3a1d" PRIMARY KEY ("id"))`);
await queryRunner.query(`CREATE TABLE "role" ("id" integer NOT NULL, "name" character varying NOT NULL, CONSTRAINT "PK_b36bcfe02fc8de3c57a8b2391c2" PRIMARY KEY ("id"))`);
await queryRunner.query(`CREATE TABLE "status" ("id" integer NOT NULL, "name" character varying NOT NULL, CONSTRAINT "PK_e12743a7086ec826733f54e1d95" PRIMARY KEY ("id"))`);
await queryRunner.query(`CREATE TABLE "user" ("id" SERIAL NOT NULL, "email" character varying, "password" character varying, "provider" character varying NOT NULL DEFAULT 'email', "socialId" character varying, "firstName" character varying, "lastName" character varying, "hash" character varying, "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP, "photoId" uuid, "roleId" integer, "statusId" integer, CONSTRAINT "UQ_e12875dfb3b1d92d7d7c5377e22" UNIQUE ("email"), CONSTRAINT "PK_cace4a159ff9f2512dd42373760" PRIMARY KEY ("id"))`);
await queryRunner.query(`CREATE INDEX "IDX_9bd2fe7a8e694dedc4ec2f666f" ON "user" ("socialId") `);
await queryRunner.query(`CREATE INDEX "IDX_58e4dbff0e1a32a9bdc861bb29" ON "user" ("firstName") `);
await queryRunner.query(`CREATE INDEX "IDX_f0e1b4ecdca13b177e2e3a0613" ON "user" ("lastName") `);
await queryRunner.query(`CREATE INDEX "IDX_e282acb94d2e3aec10f480e4f6" ON "user" ("hash") `);
await queryRunner.query(`CREATE TABLE "forgot" ("id" SERIAL NOT NULL, "hash" character varying NOT NULL, "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP, "userId" integer, CONSTRAINT "PK_087959f5bb89da4ce3d763eab75" PRIMARY KEY ("id"))`);
await queryRunner.query(`CREATE INDEX "IDX_df507d27b0fb20cd5f7bef9b9a" ON "forgot" ("hash") `);
await queryRunner.query(`ALTER TABLE "user" ADD CONSTRAINT "FK_75e2be4ce11d447ef43be0e374f" FOREIGN KEY ("photoId") REFERENCES "file"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
await queryRunner.query(`ALTER TABLE "user" ADD CONSTRAINT "FK_c28e52f758e7bbc53828db92194" FOREIGN KEY ("roleId") REFERENCES "role"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
await queryRunner.query(`ALTER TABLE "user" ADD CONSTRAINT "FK_dc18daa696860586ba4667a9d31" FOREIGN KEY ("statusId") REFERENCES "status"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
await queryRunner.query(`ALTER TABLE "forgot" ADD CONSTRAINT "FK_31f3c80de0525250f31e23a9b83" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "forgot" DROP CONSTRAINT "FK_31f3c80de0525250f31e23a9b83"`);
await queryRunner.query(`ALTER TABLE "user" DROP CONSTRAINT "FK_dc18daa696860586ba4667a9d31"`);
await queryRunner.query(`ALTER TABLE "user" DROP CONSTRAINT "FK_c28e52f758e7bbc53828db92194"`);
await queryRunner.query(`ALTER TABLE "user" DROP CONSTRAINT "FK_75e2be4ce11d447ef43be0e374f"`);
await queryRunner.query(`DROP INDEX "IDX_df507d27b0fb20cd5f7bef9b9a"`);
await queryRunner.query(`DROP TABLE "forgot"`);
await queryRunner.query(`DROP INDEX "IDX_e282acb94d2e3aec10f480e4f6"`);
await queryRunner.query(`DROP INDEX "IDX_f0e1b4ecdca13b177e2e3a0613"`);
await queryRunner.query(`DROP INDEX "IDX_58e4dbff0e1a32a9bdc861bb29"`);
await queryRunner.query(`DROP INDEX "IDX_9bd2fe7a8e694dedc4ec2f666f"`);
await queryRunner.query(`DROP TABLE "user"`);
await queryRunner.query(`DROP TABLE "status"`);
await queryRunner.query(`DROP TABLE "role"`);
await queryRunner.query(`DROP TABLE "file"`);
}
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`CREATE TABLE "file" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "path" character varying NOT NULL, CONSTRAINT "PK_36b46d232307066b3a2c9ea3a1d" PRIMARY KEY ("id"))`,
);
await queryRunner.query(
`CREATE TABLE "role" ("id" integer NOT NULL, "name" character varying NOT NULL, CONSTRAINT "PK_b36bcfe02fc8de3c57a8b2391c2" PRIMARY KEY ("id"))`,
);
await queryRunner.query(
`CREATE TABLE "status" ("id" integer NOT NULL, "name" character varying NOT NULL, CONSTRAINT "PK_e12743a7086ec826733f54e1d95" PRIMARY KEY ("id"))`,
);
await queryRunner.query(
`CREATE TABLE "user" ("id" SERIAL NOT NULL, "email" character varying, "password" character varying, "provider" character varying NOT NULL DEFAULT 'email', "socialId" character varying, "firstName" character varying, "lastName" character varying, "hash" character varying, "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP, "photoId" uuid, "roleId" integer, "statusId" integer, CONSTRAINT "UQ_e12875dfb3b1d92d7d7c5377e22" UNIQUE ("email"), CONSTRAINT "PK_cace4a159ff9f2512dd42373760" PRIMARY KEY ("id"))`,
);
await queryRunner.query(
`CREATE INDEX "IDX_9bd2fe7a8e694dedc4ec2f666f" ON "user" ("socialId") `,
);
await queryRunner.query(
`CREATE INDEX "IDX_58e4dbff0e1a32a9bdc861bb29" ON "user" ("firstName") `,
);
await queryRunner.query(
`CREATE INDEX "IDX_f0e1b4ecdca13b177e2e3a0613" ON "user" ("lastName") `,
);
await queryRunner.query(
`CREATE INDEX "IDX_e282acb94d2e3aec10f480e4f6" ON "user" ("hash") `,
);
await queryRunner.query(
`CREATE TABLE "forgot" ("id" SERIAL NOT NULL, "hash" character varying NOT NULL, "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP, "userId" integer, CONSTRAINT "PK_087959f5bb89da4ce3d763eab75" PRIMARY KEY ("id"))`,
);
await queryRunner.query(
`CREATE INDEX "IDX_df507d27b0fb20cd5f7bef9b9a" ON "forgot" ("hash") `,
);
await queryRunner.query(
`ALTER TABLE "user" ADD CONSTRAINT "FK_75e2be4ce11d447ef43be0e374f" FOREIGN KEY ("photoId") REFERENCES "file"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`,
);
await queryRunner.query(
`ALTER TABLE "user" ADD CONSTRAINT "FK_c28e52f758e7bbc53828db92194" FOREIGN KEY ("roleId") REFERENCES "role"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`,
);
await queryRunner.query(
`ALTER TABLE "user" ADD CONSTRAINT "FK_dc18daa696860586ba4667a9d31" FOREIGN KEY ("statusId") REFERENCES "status"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`,
);
await queryRunner.query(
`ALTER TABLE "forgot" ADD CONSTRAINT "FK_31f3c80de0525250f31e23a9b83" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`,
);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "forgot" DROP CONSTRAINT "FK_31f3c80de0525250f31e23a9b83"`,
);
await queryRunner.query(
`ALTER TABLE "user" DROP CONSTRAINT "FK_dc18daa696860586ba4667a9d31"`,
);
await queryRunner.query(
`ALTER TABLE "user" DROP CONSTRAINT "FK_c28e52f758e7bbc53828db92194"`,
);
await queryRunner.query(
`ALTER TABLE "user" DROP CONSTRAINT "FK_75e2be4ce11d447ef43be0e374f"`,
);
await queryRunner.query(`DROP INDEX "IDX_df507d27b0fb20cd5f7bef9b9a"`);
await queryRunner.query(`DROP TABLE "forgot"`);
await queryRunner.query(`DROP INDEX "IDX_e282acb94d2e3aec10f480e4f6"`);
await queryRunner.query(`DROP INDEX "IDX_f0e1b4ecdca13b177e2e3a0613"`);
await queryRunner.query(`DROP INDEX "IDX_58e4dbff0e1a32a9bdc861bb29"`);
await queryRunner.query(`DROP INDEX "IDX_9bd2fe7a8e694dedc4ec2f666f"`);
await queryRunner.query(`DROP TABLE "user"`);
await queryRunner.query(`DROP TABLE "status"`);
await queryRunner.query(`DROP TABLE "role"`);
await queryRunner.query(`DROP TABLE "file"`);
}
}
2 changes: 1 addition & 1 deletion seeds/20200615162100-role.seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Role } from 'src/roles/role.entity';
import { RoleEnum } from 'src/roles/roles.enum';

export default class CreateRole implements Seeder {
public async run(factory: Factory, connection: Connection): Promise<any> {
public async run(factory: Factory, connection: Connection): Promise<void> {
const countUser = await connection
.createQueryBuilder()
.select()
Expand Down
2 changes: 1 addition & 1 deletion seeds/20200616115700-status.seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Status } from 'src/statuses/status.entity';
import { StatusEnum } from 'src/statuses/statuses.enum';

export default class CreateStatus implements Seeder {
public async run(factory: Factory, connection: Connection): Promise<any> {
public async run(factory: Factory, connection: Connection): Promise<void> {
const count = await connection
.createQueryBuilder()
.select()
Expand Down
2 changes: 1 addition & 1 deletion seeds/20200626123300-admin.seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { StatusEnum } from '../src/statuses/statuses.enum';
import { plainToClass } from 'class-transformer';

export default class CreateAdmin implements Seeder {
public async run(factory: Factory, connection: Connection): Promise<any> {
public async run(factory: Factory, connection: Connection): Promise<void> {
const countAdmin = await connection
.createQueryBuilder()
.select()
Expand Down
2 changes: 1 addition & 1 deletion seeds/20201028093400-user.seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { StatusEnum } from '../src/statuses/statuses.enum';
import { plainToClass } from 'class-transformer';

export default class CreateAdmin implements Seeder {
public async run(factory: Factory, connection: Connection): Promise<any> {
public async run(factory: Factory, connection: Connection): Promise<void> {
const countUser = await connection
.createQueryBuilder()
.select()
Expand Down
11 changes: 7 additions & 4 deletions src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import { HeaderResolver } from 'nestjs-i18n';
TypeOrmModule.forRootAsync({
imports: [ConfigModule],
inject: [ConfigService],
useFactory: async (configService: ConfigService) =>
useFactory: (configService: ConfigService) =>
({
type: configService.get('database.type'),
url: configService.get('database.url'),
Expand All @@ -67,7 +67,7 @@ import { HeaderResolver } from 'nestjs-i18n';
extra: {
// based on https://node-postgres.com/api/pool
// max connection pool size
max: 100,
max: configService.get('database.maxConnections'),
},
} as ConnectionOptions),
}),
Expand All @@ -92,7 +92,10 @@ import { HeaderResolver } from 'nestjs-i18n';
)}" <${configService.get('mail.defaultEmail')}>`,
},
template: {
dir: path.join(process.env.PWD, 'mail-templates'),
dir: path.join(
configService.get('app.workingDirectory'),
'mail-templates',
),
adapter: new HandlebarsAdapter(),
options: {
strict: true,
Expand All @@ -104,7 +107,7 @@ import { HeaderResolver } from 'nestjs-i18n';
useFactory: (configService: ConfigService) => ({
fallbackLanguage: configService.get('app.fallbackLanguage'),
parserOptions: {
path: path.join(process.env.PWD, 'i18n'),
path: path.join(configService.get('app.workingDirectory'), 'i18n'),
},
}),
parser: I18nJsonParser,
Expand Down
2 changes: 1 addition & 1 deletion src/apple/apple.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Injectable } from '@nestjs/common';
import appleSigninAuth from 'apple-signin-auth';
import { ConfigService } from '@nestjs/config';
import { Tokens } from '../social/tokens';
import { SocialInterface } from '../social/social.interface';
import { SocialInterface } from '../social/interfaces/social.interface';

@Injectable()
export class AppleService {
Expand Down
4 changes: 2 additions & 2 deletions src/auth/auth.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import {
MinLength,
Validate,
} from 'class-validator';
import { IsNotExist } from '../utils/is-not-exists.validator';
import { IsExist } from '../utils/is-exists.validator';
import { IsNotExist } from '../utils/validators/is-not-exists.validator';
import { IsExist } from '../utils/validators/is-exists.validator';
import { FileEntity } from '../files/file.entity';
import { Tokens } from 'src/social/tokens';
import { AuthProvidersEnum } from './auth-providers.enum';
Expand Down
6 changes: 3 additions & 3 deletions src/auth/auth.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { AuthController } from './auth.controller';
import { AuthService } from './auth.service';
import { PassportModule } from '@nestjs/passport';
import { JwtModule } from '@nestjs/jwt';
import { JwtStrategy } from './jwt.strategy';
import { JwtStrategy } from './strategies/jwt.strategy';
import { TypeOrmModule } from '@nestjs/typeorm';
import { User } from '../users/user.entity';
import { ConfigModule, ConfigService } from '@nestjs/config';
import { AnonymousStrategy } from './anonymous.strategy';
import { AnonymousStrategy } from './strategies/anonymous.strategy';
import { Forgot } from 'src/forgot/forgot.entity';
import { AppleModule } from 'src/apple/apple.module';
import { FacebookModule } from 'src/facebook/facebook.module';
Expand All @@ -28,7 +28,7 @@ import { UsersModule } from 'src/users/users.module';
JwtModule.registerAsync({
imports: [ConfigModule],
inject: [ConfigService],
useFactory: async (configService: ConfigService) => ({
useFactory: (configService: ConfigService) => ({
secret: configService.get('auth.secret'),
signOptions: {
expiresIn: configService.get('auth.expires'),
Expand Down
6 changes: 3 additions & 3 deletions src/auth/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { AuthProvidersEnum } from './auth-providers.enum';
import { AppleService } from 'src/apple/apple.service';
import { FacebookService } from 'src/facebook/facebook.service';
import { GoogleService } from 'src/google/google.service';
import { SocialInterface } from 'src/social/social.interface';
import { SocialInterface } from 'src/social/interfaces/social.interface';
import { TwitterService } from 'src/twitter/twitter.service';
import { I18nService } from 'nestjs-i18n';

Expand Down Expand Up @@ -243,7 +243,7 @@ export class AuthService {
user.status = plainToClass(Status, {
id: StatusEnum.active,
});
user.save();
await user.save();
}

async forgotPassword(email: string): Promise<void> {
Expand Down Expand Up @@ -316,7 +316,7 @@ export class AuthService {

const user = forgot.user;
user.password = password;
user.save();
await user.save();
await this.forgotRepository.softDelete(forgot.id);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export class AnonymousStrategy extends PassportStrategy(Strategy) {
super();
}

public async validate(payload: unknown, request: unknown): Promise<unknown> {
public validate(payload: unknown, request: unknown): unknown {
return request;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ExtractJwt, Strategy } from 'passport-jwt';
import { Injectable, UnauthorizedException } from '@nestjs/common';
import { JwtService } from '@nestjs/jwt';
import { PassportStrategy } from '@nestjs/passport';
import { User } from '../users/user.entity';
import { User } from '../../users/user.entity';
import { ConfigService } from '@nestjs/config';

type JwtPayload = Pick<User, 'id' | 'role'> & { iat: number; exp: number };
Expand All @@ -19,7 +19,7 @@ export class JwtStrategy extends PassportStrategy(Strategy) {
});
}

public async validate(payload: JwtPayload) {
public validate(payload: JwtPayload) {
if (!payload.id) {
throw new UnauthorizedException();
}
Expand Down
1 change: 1 addition & 0 deletions src/config/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { registerAs } from '@nestjs/config';
export default registerAs('app', () => ({
nodeEnv: process.env.NODE_ENV,
name: process.env.APP_NAME,
workingDirectory: process.env.PWD,
frontendDomain: process.env.FRONTEND_DOMAIN,
backendDomain: process.env.BACKEND_DOMAIN,
port: parseInt(process.env.APP_PORT || process.env.PORT, 10) || 3000,
Expand Down
1 change: 1 addition & 0 deletions src/config/database.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ export default registerAs('database', () => ({
name: process.env.DATABASE_NAME,
username: process.env.DATABASE_USERNAME,
synchronize: process.env.DATABASE_SYNCHRONIZE === 'true',
maxConnections: parseInt(process.env.DATABASE_MAX_CONNECTIONS, 10) || 100,
}));
4 changes: 2 additions & 2 deletions src/facebook/facebook.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { Injectable } from '@nestjs/common';
import { Facebook } from 'fb';
import { ConfigService } from '@nestjs/config';
import { Tokens } from '../social/tokens';
import { SocialInterface } from '../social/social.interface';
import { FacebookInterface } from './facebook.interface';
import { SocialInterface } from '../social/interfaces/social.interface';
import { FacebookInterface } from './interfaces/facebook.interface';

@Injectable()
export class FacebookService {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/files/files.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { FilesService } from './files.service';
MulterModule.registerAsync({
imports: [ConfigModule],
inject: [ConfigService],
useFactory: async (configService: ConfigService) => {
useFactory: (configService: ConfigService) => {
const storages = {
local: () =>
diskStorage({
Expand Down
2 changes: 1 addition & 1 deletion src/google/google.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Injectable } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import { OAuth2Client } from 'google-auth-library';
import { Tokens } from '../social/tokens';
import { SocialInterface } from '../social/social.interface';
import { SocialInterface } from '../social/interfaces/social.interface';

@Injectable()
export class GoogleService {
Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ async function bootstrap() {

await app.listen(configService.get('app.port'));
}
bootstrap();
void bootstrap();
File renamed without changes.
2 changes: 1 addition & 1 deletion src/twitter/twitter.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Injectable } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import * as Twitter from 'twitter';
import { Tokens } from '../social/tokens';
import { SocialInterface } from '../social/social.interface';
import { SocialInterface } from '../social/interfaces/social.interface';

@Injectable()
export class TwitterService {
Expand Down
4 changes: 2 additions & 2 deletions src/users/user.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ import { ApiProperty } from '@nestjs/swagger';
import { Role } from '../roles/role.entity';
import { IsEmail, IsNotEmpty, MinLength, Validate } from 'class-validator';
import { Status } from '../statuses/status.entity';
import { IsNotExist } from '../utils/is-not-exists.validator';
import { IsNotExist } from '../utils/validators/is-not-exists.validator';
import { FileEntity } from '../files/file.entity';
import { IsExist } from '../utils/is-exists.validator';
import { IsExist } from '../utils/validators/is-exists.validator';
import * as bcrypt from 'bcryptjs';
import { EntityHelper } from 'src/utils/entity-helper';
import { AuthProvidersEnum } from 'src/auth/auth-providers.enum';
Expand Down
5 changes: 1 addition & 4 deletions src/utils/serializer.interceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@ import deepMapObject from './deep-map-object';

@Injectable()
export class SerializerInterceptor implements NestInterceptor {
async intercept(
context: ExecutionContext,
next: CallHandler,
): Promise<Observable<unknown>> {
intercept(context: ExecutionContext, next: CallHandler): Observable<unknown> {
return next.handle().pipe(
map(data => {
return deepMapObject(data, value => {
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 86fa3ec

Please sign in to comment.