@nampham0494/nest-crud-generate
Advanced tools
Comparing version 1.0.7 to 1.0.8
@@ -41,4 +41,7 @@ <% if (crud && type === 'rest') { %>import { | ||
@UseGuards(AuthGuard('jwt'), RoleGuard) | ||
async create(@Body() create<%= singular(classify(name)) %>Dto: Create<%= singular(classify(name)) %>Dto): Promise<<%= singular(classify(name)) %>Entity> { | ||
const created = await this.<%= lowercased(name) %>Service.create(create<%= singular(classify(name)) %>Dto); | ||
async create( | ||
@Body() create<%= singular(classify(name)) %>Dto: Create<%= singular(classify(name)) %>Dto, | ||
@Query('crudQuery') crudQuery: string, | ||
): Promise<<%= singular(classify(name)) %>Entity> { | ||
const created = await this.<%= lowercased(name) %>Service.create(create<%= singular(classify(name)) %>Dto, { crudQuery }); | ||
return created; | ||
@@ -50,4 +53,7 @@ } | ||
@UseGuards(AuthGuard('jwt'), RoleGuard) | ||
async findOne(@Param('id') id: string): Promise<<%= singular(classify(name)) %>Entity> { | ||
const match = await this.<%= lowercased(name) %>Service.findOne(id); | ||
async findOne( | ||
@Param('id') id: string, | ||
@Query('crudQuery') crudQuery: string, | ||
): Promise<<%= singular(classify(name)) %>Entity> { | ||
const match = await this.<%= lowercased(name) %>Service.findOne(id, { crudQuery }); | ||
return match; | ||
@@ -62,4 +68,5 @@ } | ||
@Body() update<%= singular(classify(name)) %>Dto: Update<%= singular(classify(name)) %>Dto, | ||
@Query('crudQuery') crudQuery: string, | ||
): Promise<<%= singular(classify(name)) %>Entity> { | ||
const updated = await this.<%= lowercased(name) %>Service.update(id, update<%= singular(classify(name)) %>Dto); | ||
const updated = await this.<%= lowercased(name) %>Service.update(id, update<%= singular(classify(name)) %>Dto, { crudQuery }); | ||
return updated; | ||
@@ -71,5 +78,8 @@ } | ||
@UseGuards(AuthGuard('jwt'), RoleGuard) | ||
async remove(@Param('id') id: string): Promise<<%= singular(classify(name)) %>Entity> { | ||
return this.<%= lowercased(name) %>Service.remove(id); | ||
async remove( | ||
@Param('id') id: string, | ||
@Query('crudQuery') crudQuery: string, | ||
): Promise<<%= singular(classify(name)) %>Entity> { | ||
return this.<%= lowercased(name) %>Service.remove(id, { crudQuery }); | ||
}<% } %> | ||
} |
{ | ||
"name": "@nampham0494/nest-crud-generate", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "Nest", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
191643
4619