feat(demo): add bundles section to material lending page (#5677)

Co-authored-by: d.strigo <d.strigo@akveo.com>
This commit is contained in:
Denis Strigo 2020-05-15 11:01:19 +03:00 committed by Sergey Andrievskiy
parent c416d894d4
commit 50b5696c3b
5 changed files with 38 additions and 13 deletions

View file

@ -25,6 +25,11 @@ export const BUNDLE_LICENSE = {
developer: 'developer',
};
export const STORE_PRODUCTS_URL = {
base: 'https://store.akveo.com/collections/frontpage/products.json',
material: 'https://store.akveo.com/collections/material-bundles/products.json',
};
export class Feature {
text: string;
availableInPersonalLicence: boolean;
@ -34,7 +39,6 @@ export class Feature {
@Injectable()
export class BundlesService {
private readonly STORE_PRODUCTS: string = 'https://store.akveo.com/collections/frontpage/products.json';
private readonly STORE: string = 'https://store.akveo.com/products';
private features: Feature[] = [
@ -81,8 +85,8 @@ export class BundlesService {
return observableOf(this.features);
}
getProducts(): Observable<Product[]> {
return this.http.get(this.STORE_PRODUCTS)
getProducts(url: string): Observable<Product[]> {
return this.http.get(url)
.pipe(map((result: any) => {
return result.products.map((item: any) => {
return {