Commit c0aa841fc729ff7a540ff4335ccec6e86545631e
1 parent
b3c2dc63ab
Exists in
master
Cambio en variable api url
Showing
2 changed files
with
8 additions
and
9 deletions
Show diff stats
src/app/components/abm-imagenes/abm-imagenes.component.html
1 | -<p>abm-imagenes works!</p> | |
2 | 1 | <app-header></app-header> |
3 | 2 | |
4 | 3 | <div class="container-fluid"> |
... | ... | @@ -42,13 +41,13 @@ |
42 | 41 | <img |
43 | 42 | *ngIf="articulo.imagenes.length == 0" |
44 | 43 | class="fade-in w-100 mx-auto img-fluid" |
45 | - src="{{apiUrl}}/imagenes/noImage.jpg"> | |
44 | + src="{{apiImagenes}}/imagenes/noImage.jpg"> | |
46 | 45 | <carousel [interval]="false"> |
47 | 46 | <slide *ngFor="let item of articulo.imagenes; let index = index"> |
48 | 47 | <img |
49 | 48 | *ngIf="!item.fromGallery" |
50 | 49 | class="fade-in img-fluid w-100" |
51 | - src="{{apiUrl}}/imagenes/{{item.imagen}}"> | |
50 | + src="{{apiImagenes}}/imagenes/{{item.imagen}}"> | |
52 | 51 | <img |
53 | 52 | *ngIf="item.fromGallery" |
54 | 53 | class="fade-in img-fluid w-100" |
src/app/components/abm-imagenes/abm-imagenes.component.ts
... | ... | @@ -12,18 +12,18 @@ import { HttpClient } from '@angular/common/http'; |
12 | 12 | |
13 | 13 | export class AbmImagenesComponent implements OnInit { |
14 | 14 | |
15 | - apiUrl = appSettings.apiImagenes; | |
15 | + apiImagenes = appSettings.apiImagenes; | |
16 | 16 | articulos: Producto[] = []; |
17 | 17 | private auxProductos: Producto[] = []; |
18 | 18 | private searchTerm: string = ''; |
19 | 19 | private paginationData: any; |
20 | 20 | private disabledPaginador: boolean = false; |
21 | 21 | |
22 | - constructor(private productoService: ImagenesService, private http: HttpClient) { } | |
22 | + constructor(private imagenService: ImagenesService, private http: HttpClient) { } | |
23 | 23 | |
24 | 24 | ngOnInit() { |
25 | 25 | |
26 | - this.productoService.getAllWithPaginator() | |
26 | + this.imagenService.getAllWithPaginator() | |
27 | 27 | .subscribe((res) => { |
28 | 28 | |
29 | 29 | this.articulos = res.data; |
... | ... | @@ -71,7 +71,7 @@ export class AbmImagenesComponent implements OnInit { |
71 | 71 | |
72 | 72 | saveInBase(imagenAguardar) { |
73 | 73 | |
74 | - this.productoService.saveInBase(imagenAguardar.imagen) | |
74 | + this.imagenService.saveInBase(imagenAguardar.imagen) | |
75 | 75 | .subscribe(res => { |
76 | 76 | imagenAguardar.imagen['id'] = res[0]; |
77 | 77 | imagenAguardar.imagen['fromGallery'] = true; |
... | ... | @@ -101,7 +101,7 @@ export class AbmImagenesComponent implements OnInit { |
101 | 101 | imagenes[index].name = imagenes[index].imagen; |
102 | 102 | } |
103 | 103 | |
104 | - this.productoService.deleteImage(imagenes[index]) | |
104 | + this.imagenService.deleteImage(imagenes[index]) | |
105 | 105 | .subscribe(res => { |
106 | 106 | |
107 | 107 | if (res) { |
... | ... | @@ -112,7 +112,7 @@ export class AbmImagenesComponent implements OnInit { |
112 | 112 | |
113 | 113 | pageChanged(event: any): void { |
114 | 114 | this.disabledPaginador = true; |
115 | - this.productoService.getAllWithPaginator(event.page) | |
115 | + this.imagenService.getAllWithPaginator(event.page) | |
116 | 116 | .subscribe((res) => { |
117 | 117 | this.disabledPaginador = false; |
118 | 118 | this.articulos = res.data; |