mirror of
https://gitlab.com/mobicoop/v3/service/matcher.git
synced 2025-12-30 22:32:40 +00:00
refactor to ddh, first commit
This commit is contained in:
14
old/modules/utils/pipes/rpc.validation-pipe.ts
Normal file
14
old/modules/utils/pipes/rpc.validation-pipe.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { Injectable, ValidationPipe } from '@nestjs/common';
|
||||
import { RpcException } from '@nestjs/microservices';
|
||||
|
||||
@Injectable()
|
||||
export class RpcValidationPipe extends ValidationPipe {
|
||||
createExceptionFactory() {
|
||||
return (validationErrors = []) => {
|
||||
return new RpcException({
|
||||
code: 3,
|
||||
message: this.flattenValidationErrors(validationErrors),
|
||||
});
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user