Commit c9ac99b3 authored by nanahira's avatar nanahira

add fineOneId

parent fe1dda15
import { Body, Delete, Get, Patch, Post, Query } from '@nestjs/common'; import {
Body,
Delete,
Get,
Param,
ParseIntPipe,
Patch,
Post,
Query,
} from '@nestjs/common';
import { import {
BlankReturnMessageDto, BlankReturnMessageDto,
PaginatedReturnMessageDto, PaginatedReturnMessageDto,
...@@ -78,6 +87,14 @@ export class RestfulFactory<T extends TimeBase> { ...@@ -78,6 +87,14 @@ export class RestfulFactory<T extends TimeBase> {
]); ]);
} }
findOneId() {
if (this.idType === Number) {
return Param('id', ParseIntPipe);
} else {
return Param('id');
}
}
findAll(extras: Partial<OperationObject> = {}): MethodDecorator { findAll(extras: Partial<OperationObject> = {}): MethodDecorator {
return MergeMethodDecorators([ return MergeMethodDecorators([
Get(), Get(),
......
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