diff --git a/src/MistoxWebsite.Client/src/app/models/Product.ts b/src/MistoxWebsite.Client/src/app/models/Product.ts index 436a3fc..1f359f5 100644 --- a/src/MistoxWebsite.Client/src/app/models/Product.ts +++ b/src/MistoxWebsite.Client/src/app/models/Product.ts @@ -11,5 +11,5 @@ export class Product { export class ProductImage { imageID: number = 0; productID: number = 0; - image: File | null = null; + image: Blob | null = null; } \ No newline at end of file diff --git a/src/MistoxWebsite.Client/src/app/pages/store/catalog/catalog.component.ts b/src/MistoxWebsite.Client/src/app/pages/store/catalog/catalog.component.ts index 0affb4d..ab4312b 100644 --- a/src/MistoxWebsite.Client/src/app/pages/store/catalog/catalog.component.ts +++ b/src/MistoxWebsite.Client/src/app/pages/store/catalog/catalog.component.ts @@ -20,9 +20,20 @@ export class CatalogComponent { constructor( private http: HttpClient, private router: Router, private route: ActivatedRoute, private title: Title, public auth: Authentication ) { this.title.setTitle("Store | Mistox"); + // load each product http.post("https://mistox.com/api/product/getall", null).subscribe( response => { this.Products = response; + + // Load each image + this.Products.forEach(item => { + item.images.forEach(img => { + http.get("https://mistox.com/api/productimage/get?ProductID=" + img.productID + "&ImageID=" + img.imageID, { responseType: 'blob' }).subscribe(blob => { + img.image = blob; + }); + }); + }); + } ) };