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
+8 -6
View File
@@ -23,15 +23,17 @@ export class MarcaService {
}
findById(id_marca: number, tipo: string, validarExistencia = true) {
return this.repository.findOne({ id_marca, tipo }).then((marca) => {
if (validarExistencia && !marca)
throw new ConflictException('No existe esta marca.');
return marca;
});
return this.repository
.findOne({ where: { id_marca, tipo } })
.then((marca) => {
if (validarExistencia && !marca)
throw new ConflictException('No existe esta marca.');
return marca;
});
}
findByMarca(marca: string, tipo: string, validarExistencia = true) {
return this.repository.findOne({ marca, tipo }).then((marca) => {
return this.repository.findOne({ where: { marca, tipo } }).then((marca) => {
if (validarExistencia && !marca)
throw new ConflictException('No existe esta marca.');
return marca;