update librerias
This commit is contained in:
@@ -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;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user