Commit 3cf12bc9 authored by nanahira's avatar nanahira

fix pipe conflict

parent a6a229ca
import { ValidationPipe } from '@nestjs/common'; import { ValidationPipe } from '@nestjs/common';
export const CreatePipe = new ValidationPipe({ export const CreatePipe = () =>
transform: true, new ValidationPipe({
transformOptions: { groups: ['c'], enableImplicitConversion: true }, transform: true,
}); transformOptions: { groups: ['c'], enableImplicitConversion: true },
});
export const GetPipe = new ValidationPipe({ export const GetPipe = () =>
transform: true, new ValidationPipe({
transformOptions: { groups: ['r'], enableImplicitConversion: true }, transform: true,
skipMissingProperties: true, transformOptions: { groups: ['r'], enableImplicitConversion: true },
skipNullProperties: true, skipMissingProperties: true,
skipUndefinedProperties: true, skipNullProperties: true,
}); skipUndefinedProperties: true,
});
export const UpdatePipe = new ValidationPipe({ export const UpdatePipe = () =>
transform: true, new ValidationPipe({
transformOptions: { groups: ['u'], enableImplicitConversion: true }, transform: true,
skipMissingProperties: true, transformOptions: { groups: ['u'], enableImplicitConversion: true },
skipNullProperties: true, skipMissingProperties: true,
skipUndefinedProperties: true, skipNullProperties: true,
}); skipUndefinedProperties: true,
});
...@@ -89,7 +89,7 @@ export class RestfulFactory<T> { ...@@ -89,7 +89,7 @@ export class RestfulFactory<T> {
} }
createParam() { createParam() {
return Body(CreatePipe); return Body(CreatePipe());
} }
findOne(extras: Partial<OperationObject> = {}): MethodDecorator { findOne(extras: Partial<OperationObject> = {}): MethodDecorator {
...@@ -121,7 +121,7 @@ export class RestfulFactory<T> { ...@@ -121,7 +121,7 @@ export class RestfulFactory<T> {
} }
findAllParam() { findAllParam() {
return Query(GetPipe); return Query(GetPipe());
} }
update(extras: Partial<OperationObject> = {}): MethodDecorator { update(extras: Partial<OperationObject> = {}): MethodDecorator {
...@@ -138,7 +138,7 @@ export class RestfulFactory<T> { ...@@ -138,7 +138,7 @@ export class RestfulFactory<T> {
} }
updateParam() { updateParam() {
return Body(UpdatePipe); return Body(UpdatePipe());
} }
delete(extras: Partial<OperationObject> = {}): MethodDecorator { delete(extras: Partial<OperationObject> = {}): MethodDecorator {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment