import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { map, tap, timeout } from 'rxjs/operators'; import { User } from './Models/User'; import { Tenant } from './Models/Tenant'; @Injectable({ providedIn: 'root' }) export class MasterLayoutService { constructor(private http: HttpClient) { } private userInfoAPI = '/api/users'; private tenantAPI = '/api/tenants'; testUsers = [ // '57764', // ABC Legal Services // '57768', // Advanced Attorney Services // '57796', // ALL-N-ONE Legal Support // '59088', // Attorney’s Certified Services // '57769', // Bosco Legal Services // '57782', // Countrywide Process // '79588', // D&T Legal Services // '57783', // Direct Legal Support // '59021', // J. Haber Attorney Services '45987', // Janney and Janney // '57792', // Knox Services // '57760', // LegalConnect // '74342', // LegalConnect Demo // '82434', // Pallati Attorney Service // '57780', // ProLegal // '19018', // Rapid Legal // '57762', // Rezac-Meyer Attorney Service // '42372', // Saddleback Attorney Service // '59220', // Snap Legal Network // '51668', // Sterling Madison // '56784', // Swift Attorney Service // '73292', // Test Attorney Service // '57267', // United Process Servers // '57775' // Wheels of Justice ]; getUserInfo() { // Testing user const userID = this.testUsers[0]; return this.http.get(this.userInfoAPI + '/' + userID).pipe( map(res => { return res; }), tap(res => console.log('Service > getUserInfo: ' + JSON.stringify({ data: res }, null, 4))) ); } getTenantInfo(tenantID: number) { return this.http.get(this.tenantAPI + '/' + tenantID).pipe( map(res => res), tap(res => console.log('Service > getTenantInfo: ' + JSON.stringify({ data: res }, null, 4))), ); } getTenantSmallLogo(tenantName: string) { if (tenantName) { return tenantName.substring(0, 1).toUpperCase(); } return ':)'; } }