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 = () =>
new ValidationPipe({
transform: true, transform: true,
transformOptions: { groups: ['c'], enableImplicitConversion: true }, transformOptions: { groups: ['c'], enableImplicitConversion: true },
}); });
export const GetPipe = new ValidationPipe({ export const GetPipe = () =>
new ValidationPipe({
transform: true, transform: true,
transformOptions: { groups: ['r'], enableImplicitConversion: true }, transformOptions: { groups: ['r'], enableImplicitConversion: true },
skipMissingProperties: true, skipMissingProperties: true,
skipNullProperties: true, skipNullProperties: true,
skipUndefinedProperties: true, skipUndefinedProperties: true,
}); });
export const UpdatePipe = new ValidationPipe({ export const UpdatePipe = () =>
new ValidationPipe({
transform: true, transform: true,
transformOptions: { groups: ['u'], enableImplicitConversion: true }, transformOptions: { groups: ['u'], enableImplicitConversion: true },
skipMissingProperties: true, skipMissingProperties: true,
skipNullProperties: true, skipNullProperties: true,
skipUndefinedProperties: 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