update librerias

This commit is contained in:
2022-08-23 17:12:09 -05:00
parent 7f7dfbe9c1
commit 2a031a7658
25 changed files with 2775 additions and 3297 deletions
+14 -10
View File
@@ -25,17 +25,21 @@ export class ModeloService {
}
findById(id_modelo: number, tipo: string, validarExistencia = true) {
return this.repository.findOne({ id_modelo, tipo }).then((modelo) => {
if (validarExistencia && !modelo)
throw new ConflictException('No existe este modelo.');
return modelo;
});
return this.repository
.findOne({ where: { id_modelo, tipo } })
.then((modelo) => {
if (validarExistencia && !modelo)
throw new ConflictException('No existe este modelo.');
return modelo;
});
}
findByModelo(modelo: string, tipo: string, validarExistencia = true) {
return this.repository.findOne({ modelo, tipo }).then((modelo) => {
if (validarExistencia && !modelo)
throw new ConflictException('No existe este modelo.');
return modelo;
});
return this.repository
.findOne({ where: { modelo, tipo } })
.then((modelo) => {
if (validarExistencia && !modelo)
throw new ConflictException('No existe este modelo.');
return modelo;
});
}
}