From a7383be03abb140a160388159fea4d05cd20e93d Mon Sep 17 00:00:00 2001 From: Eduardo Quiros Date: Wed, 14 Jul 2021 20:49:19 -0600 Subject: [PATCH] actualizar categoria como INACTIVE esto es en lugar de eliminarlos de la base de datos, para mantener en existencia las entradas --- .../categoria/delete/categoria-delete-dialog.component.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/webapp/app/entities/categoria/delete/categoria-delete-dialog.component.ts b/src/main/webapp/app/entities/categoria/delete/categoria-delete-dialog.component.ts index e99a28e..4bffc15 100644 --- a/src/main/webapp/app/entities/categoria/delete/categoria-delete-dialog.component.ts +++ b/src/main/webapp/app/entities/categoria/delete/categoria-delete-dialog.component.ts @@ -1,5 +1,6 @@ import { Component } from '@angular/core'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; +import { EstadoCategoria } from 'app/entities/enumerations/estado-categoria.model'; import { ICategoria } from '../categoria.model'; import { CategoriaService } from '../service/categoria.service'; @@ -17,7 +18,8 @@ export class CategoriaDeleteDialogComponent { } confirmDelete(categoria: ICategoria): void { - this.categoriaService.delete(categoria.id!).subscribe(() => { + categoria.estado = EstadoCategoria.INACTIVE; + this.categoriaService.update(categoria).subscribe(() => { this.activeModal.close('deleted'); }); }