diff --git a/src/app/shared/sinonimo/sinonimo.component.ts b/src/app/shared/sinonimo/sinonimo.component.ts index bf573cd..b6407fe 100644 --- a/src/app/shared/sinonimo/sinonimo.component.ts +++ b/src/app/shared/sinonimo/sinonimo.component.ts @@ -58,19 +58,14 @@ export class SinonimoComponent implements OnInit { for (const articulo of this.articulosSelected) { ID_SINS.push(articulo.ID_SIN); - } - - for (const articulo of this.articulosSelected) { observables.push(this.articuloService.getById(articulo.id)); } forkJoin(observables) .subscribe((res: IArticulo[]) => { - for (const articulo of res) { - for (const ID_SIN of ID_SINS) { - articulo.ID_SIN = ID_SIN; - } - } + res.forEach((articulo, i) => { + articulo.ID_SIN = ID_SINS[i]; + }); this.modalRef.hide(); this.onClose.next({ articulos: res,