add auth docs, add eslint import/order

This commit is contained in:
andres
2023-07-16 19:44:58 +02:00
parent 0f3e89900a
commit aa7ece41a9
74 changed files with 1152 additions and 164 deletions

View File

@@ -42,4 +42,5 @@ export class AppSettings {
}
const env = new EnvironmentSettings((process.env.NODE_ENV || 'DEVELOPMENT') as EnvironmentsTypes)
const auth = new AuthSettings(process.env)
export const appSettings = new AppSettings(env, auth)

View File

@@ -1,4 +1,5 @@
import { Global, Module } from '@nestjs/common'
import { appSettings, AppSettings } from './app-settings'
//главный config модуль для управления env переменными импортируется в app.module.ts глобально

View File

@@ -7,6 +7,7 @@ export const validationErrorsMapper = {
): ValidationPipeErrorType[] {
return errors.flatMap(error => {
const constraints = error.constraints ?? []
return Object.entries(constraints).map(([_, value]) => ({
field: error.property,
message: value,
@@ -26,6 +27,7 @@ export function pipesSetup(app: INestApplication) {
exceptionFactory: (errors: ValidationError[]) => {
const err =
validationErrorsMapper.mapValidationErrorArrayToValidationPipeErrorTypeArray(errors)
throw new BadRequestException(err)
},
})