@mikemajesty/microservice-crud 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/cli.js +0 -1
- package/src/templates/mongo/core/use-cases/delete.js +1 -1
- package/src/templates/mongo/core/use-cases/getByID.js +1 -1
- package/src/templates/mongo/core/use-cases/update.js +1 -1
- package/src/templates/postgres/core/use-cases/delete.js +1 -1
- package/src/templates/postgres/core/use-cases/getByID.js +1 -1
- package/src/templates/postgres/core/use-cases/update.js +1 -1
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -180,7 +180,6 @@ const createMongoCrud = async (name) => {
|
|
|
180
180
|
fs.writeFileSync(`${modulesPath}/controller.ts`, getModuleControllerMongo(name))
|
|
181
181
|
fs.writeFileSync(`${modulesPath}/module.ts`, getModuleMongo(name))
|
|
182
182
|
fs.writeFileSync(`${modulesPath}/repository.ts`, getModuleRepositoryMongo(name))
|
|
183
|
-
fs.writeFileSync(`${modulesPath}/schema.ts`, getModuleSchemaMongo(name))
|
|
184
183
|
fs.writeFileSync(`${modulesPath}/swagger.ts`, getModuleSwaggerMongo(name))
|
|
185
184
|
|
|
186
185
|
return `${name}`
|
|
@@ -26,7 +26,7 @@ export class ${capitalizeFirstLetter(name)}DeleteUsecase {
|
|
|
26
26
|
const model = await this.${name}Repository.findById(id);
|
|
27
27
|
|
|
28
28
|
if (!model) {
|
|
29
|
-
throw new ApiNotFoundException(
|
|
29
|
+
throw new ApiNotFoundException();
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
const ${name} = new ${capitalizeFirstLetter(name)}Entity(model);
|
|
@@ -25,7 +25,7 @@ export class ${capitalizeFirstLetter(name)}GetByIdUsecase {
|
|
|
25
25
|
const ${name} = await this.${name}Repository.findById(id);
|
|
26
26
|
|
|
27
27
|
if (!${name}) {
|
|
28
|
-
throw new ApiNotFoundException(
|
|
28
|
+
throw new ApiNotFoundException();
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
const entity = new ${capitalizeFirstLetter(name)}Entity(${name});
|
|
@@ -27,7 +27,7 @@ export class ${capitalizeFirstLetter(name)}UpdateUsecase {
|
|
|
27
27
|
const ${name} = await this.${name}Repository.findById(input.id);
|
|
28
28
|
|
|
29
29
|
if (!${name}) {
|
|
30
|
-
throw new ApiNotFoundException(
|
|
30
|
+
throw new ApiNotFoundException();
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
const ${name}Finded = new ${capitalizeFirstLetter(name)}Entity(${name});
|
|
@@ -27,7 +27,7 @@ export class ${capitalizeFirstLetter(name)}DeleteUsecase {
|
|
|
27
27
|
const model = await this.${name}Repository.findById<DatabaseOptionsType>(id);
|
|
28
28
|
|
|
29
29
|
if (!model) {
|
|
30
|
-
throw new ApiNotFoundException(
|
|
30
|
+
throw new ApiNotFoundException();
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
const ${name} = new ${capitalizeFirstLetter(name)}Entity(model);
|
|
@@ -28,7 +28,7 @@ export class ${capitalizeFirstLetter(name)}GetByIdUsecase {
|
|
|
28
28
|
const ${name} = await this.${name}Repository.findById<DatabaseOptionsType>(id);
|
|
29
29
|
|
|
30
30
|
if (!${name}) {
|
|
31
|
-
throw new ApiNotFoundException(
|
|
31
|
+
throw new ApiNotFoundException();
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
return new ${capitalizeFirstLetter(name)}Entity(${name});
|
|
@@ -28,7 +28,7 @@ export class ${capitalizeFirstLetter(name)}UpdateUsecase {
|
|
|
28
28
|
const ${name} = await this.${name}Repository.findById<DatabaseOptionsType>(input.id);
|
|
29
29
|
|
|
30
30
|
if (!${name}) {
|
|
31
|
-
throw new ApiNotFoundException(
|
|
31
|
+
throw new ApiNotFoundException();
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
const ${name}Finded = new ${capitalizeFirstLetter(name)}Entity(${name});
|