Commit 3cf12bc9 authored by nanahira's avatar nanahira

fix pipe conflict

parent a6a229ca
import { ValidationPipe } from '@nestjs/common';
export const CreatePipe = new ValidationPipe({
transform: true,
transformOptions: { groups: ['c'], enableImplicitConversion: true },
});
export const CreatePipe = () =>
new ValidationPipe({
transform: true,
transformOptions: { groups: ['c'], enableImplicitConversion: true },
});
export const GetPipe = new ValidationPipe({
transform: true,
transformOptions: { groups: ['r'], enableImplicitConversion: true },
skipMissingProperties: true,
skipNullProperties: true,
skipUndefinedProperties: true,
});
export const GetPipe = () =>
new ValidationPipe({
transform: true,
transformOptions: { groups: ['r'], enableImplicitConversion: true },
skipMissingProperties: true,
skipNullProperties: true,
skipUndefinedProperties: true,
});
export const UpdatePipe = new ValidationPipe({
transform: true,
transformOptions: { groups: ['u'], enableImplicitConversion: true },
skipMissingProperties: true,
skipNullProperties: true,
skipUndefinedProperties: true,
});
export const UpdatePipe = () =>
new ValidationPipe({
transform: true,
transformOptions: { groups: ['u'], enableImplicitConversion: true },
skipMissingProperties: true,
skipNullProperties: true,
skipUndefinedProperties: true,
});
......@@ -89,7 +89,7 @@ export class RestfulFactory<T> {
}
createParam() {
return Body(CreatePipe);
return Body(CreatePipe());
}
findOne(extras: Partial<OperationObject> = {}): MethodDecorator {
......@@ -121,7 +121,7 @@ export class RestfulFactory<T> {
}
findAllParam() {
return Query(GetPipe);
return Query(GetPipe());
}
update(extras: Partial<OperationObject> = {}): MethodDecorator {
......@@ -138,7 +138,7 @@ export class RestfulFactory<T> {
}
updateParam() {
return Body(UpdatePipe);
return Body(UpdatePipe());
}
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