import { Injectable, } from '@angular/core'; import { HttpClient, } from '@angular/common/http'; import { CatalogResponseInterface, } from './../../../models/index'; const CATALOG_ENDPOINT = process.env.CATALOG_ENDPOINT || 'https://catalog.kite.ly/api/catalog'; const SLUG_FOR_TEMPLATE_ID_ENDPOINT = process.env.SLUG_FOR_TEMPLATE_ID_ENDPOINT || 'https://catalog.kite.ly/api/slug-for-template-id'; @Injectable() export class KiteCatalogService { constructor( private _httpClient: HttpClient, ) {} public getSlugForTemplate$(templateId: string) { return this._httpClient.get( `${SLUG_FOR_TEMPLATE_ID_ENDPOINT}/${templateId}`, ); } public getContentForSlug$(slug: string) { return this._httpClient.get( `${CATALOG_ENDPOINT}/${slug}`, ); } }