actualizar categoria como INACTIVE

esto es en lugar de eliminarlos de la base de datos, para mantener en
existencia las entradas
This commit is contained in:
Eduardo Quiros 2021-07-14 20:49:19 -06:00
parent 3fd224f4d4
commit a7383be03a
No known key found for this signature in database
GPG Key ID: B77F36C3F12720B4
1 changed files with 3 additions and 1 deletions

View File

@ -1,5 +1,6 @@
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
import { EstadoCategoria } from 'app/entities/enumerations/estado-categoria.model';
import { ICategoria } from '../categoria.model'; import { ICategoria } from '../categoria.model';
import { CategoriaService } from '../service/categoria.service'; import { CategoriaService } from '../service/categoria.service';
@ -17,7 +18,8 @@ export class CategoriaDeleteDialogComponent {
} }
confirmDelete(categoria: ICategoria): void { confirmDelete(categoria: ICategoria): void {
this.categoriaService.delete(categoria.id!).subscribe(() => { categoria.estado = EstadoCategoria.INACTIVE;
this.categoriaService.update(categoria).subscribe(() => {
this.activeModal.close('deleted'); this.activeModal.close('deleted');
}); });
} }