@vori/nest-schematics
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -33,3 +33,3 @@ <% if (crud && type === 'rest') { %>import { Get, Post, Body, Patch, Param, Delete, Req } from '@nestjs/common'; | ||
): Promise<<%= singular(classify(name)) %>Dto> { | ||
const <%= singular(camelize(name)) %> = await this.<%= lowercased(name) %>Service.create(request.user, create<%= singular(classify(name)) %>Dto); | ||
const <%= singular(camelize(name)) %> = await this.<%= lowercased(name) %>Service.create({bannerID: request.user.bannerID, dto: create<%= singular(classify(name)) %>Dto}); | ||
return new <%= singular(classify(name)) %>Dto(<%= singular(camelize(name)) %>); | ||
@@ -42,3 +42,3 @@ } | ||
public async findAll(@Req() request: RequestWithBannerUser): Promise<<%= singular(classify(name)) %>Dto[]> { | ||
const <%= camelize(name) %> = await this.<%= lowercased(name) %>Service.findAll(request.user); | ||
const <%= camelize(name) %> = await this.<%= lowercased(name) %>Service.findAll({bannerID: request.user.bannerID}); | ||
return <%= camelize(name) %>.map(<%= singular(camelize(name)) %> => new <%= singular(classify(name)) %>Dto(<%= singular(camelize(name)) %>)); | ||
@@ -52,3 +52,3 @@ } | ||
public async findOne(@Req() request: RequestWithBannerUser, @Param() params: FindOneParams) { | ||
const <%= singular(camelize(name)) %> = await this.<%= lowercased(name) %>Service.findOne(request.user, params.id); | ||
const <%= singular(camelize(name)) %> = await this.<%= lowercased(name) %>Service.findOne({bannerID: request.user.bannerID, id: params.id}); | ||
return new <%= singular(classify(name)) %>Dto(<%= singular(camelize(name)) %>); | ||
@@ -63,3 +63,3 @@ } | ||
public async update(@Req() request: RequestWithBannerUser, @Param() params: FindOneParams, @Body() update<%= singular(classify(name)) %>Dto: Update<%= singular(classify(name)) %>Dto) { | ||
const <%= singular(camelize(name)) %> = await this.<%= lowercased(name) %>Service.update(request.user, params.id, update<%= singular(classify(name)) %>Dto); | ||
const <%= singular(camelize(name)) %> = await this.<%= lowercased(name) %>Service.update({bannerID: request.user.bannerID, id: params.id, dto: update<%= singular(classify(name)) %>Dto}); | ||
return new <%= singular(classify(name)) %>Dto(<%= singular(camelize(name)) %>); | ||
@@ -73,3 +73,3 @@ } | ||
public async remove(@Req() request: RequestWithBannerUser, @Param() params: FindOneParams): Promise<void> { | ||
await this.<%= lowercased(name) %>Service.remove(request.user, params.id); | ||
await this.<%= lowercased(name) %>Service.remove({bannerID: request.user.bannerID, id: params.id}); | ||
}<% } else if (type === 'microservice' && crud) { %> | ||
@@ -76,0 +76,0 @@ |
@@ -6,2 +6,4 @@ import { faker } from '@faker-js/faker'; | ||
import { makeDatabaseID } from '@vori/utils/VoriRandom'; | ||
import { make<%= singular(classify(name)) %> } from '../fakers/<%= singular(name) %>.faker'; | ||
@@ -18,3 +20,3 @@ import { <%= singular(classify(name)) %>Dto } from './<%= singular(name) %>.dto'; | ||
const <%= singular(camelize(name)) %> = make<%= singular(classify(name)) %>({ | ||
id: faker.datatype.number({ min: 1 }).toString(), | ||
id: makeDatabaseID(), | ||
}); | ||
@@ -21,0 +23,0 @@ const dto = instanceToPlain(new <%= singular(classify(name)) %>Dto(<%= singular(camelize(name)) %>)); |
@@ -7,3 +7,3 @@ { | ||
}, | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Nest - modern, fast, powerful node.js web framework (@schematics)", | ||
@@ -10,0 +10,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
203028
229
5010