Skip to content
Prev Previous commit
Next Next commit
fix: #87 get tenant_id from AzureServices
  • Loading branch information
daros10 committed Apr 17, 2020
commit d4ff348c285ed9c8bdc86c7878aae7d7e21c5dd8
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';

import { environment } from './../../../../environments/environment';
import { AzureAdB2CService } from 'src/app/modules/login/services/azure.ad.b2c.service';
import { Observable } from 'rxjs';

@Injectable({
Expand All @@ -10,13 +11,14 @@ import { Observable } from 'rxjs';
export class CustomerService {
baseUrl = `${environment.timeTrackerApiUrl}/customers`;

constructor(private http: HttpClient) {}
constructor(private http: HttpClient, private service: AzureAdB2CService) {}

createCustomer(customerData): Observable<any> {
const body = {
...customerData,
tenant_id: sessionStorage.getItem('tenant_id'),
tenant_id: this.service.getTenantId(),
};
console.log(this.service.getTenantId());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the console.log please.

return this.http.post(this.baseUrl, body);
}
}