Skip to content

Commit 9df4cee

Browse files
committed
fix: TT-443 Fix url in prod
1 parent 8dd9d87 commit 9df4cee

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/app/modules/time-clock/services/entry.service.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ describe('EntryService', () => {
4040
});
4141

4242
it('loads an activeEntry with /running', () => {
43-
service.showOptionInDevelopment = true;
43+
service.urlInProduction = true;
4444
service.loadActiveEntry().subscribe();
4545

4646
const loadEntryRequest = httpMock.expectOne(`${service.baseUrl}/running`);
4747
expect(loadEntryRequest.request.method).toBe('GET');
4848
});
4949

5050
it('loads an activeEntry with /active/{userId}', () => {
51-
service.showOptionInDevelopment = false;
51+
service.urlInProduction = false;
5252
service.loadActiveEntry().subscribe();
5353

5454
const loadEntryRequest = httpMock.expectOne(`${service.baseUrl}/active/2`);

src/app/modules/time-clock/services/entry.service.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { TimeEntriesSummary } from '../models/time.entry.summary';
2-
import { Injectable, Input } from '@angular/core';
2+
import { Injectable } from '@angular/core';
33
import { HttpClient } from '@angular/common/http';
44

55
import { Observable } from 'rxjs';
@@ -19,11 +19,12 @@ export class EntryService {
1919

2020
static TIME_ENTRIES_DATE_TIME_FORMAT = 'yyyy-MM-ddTHH:mm:ssZZZZZ';
2121
baseUrl = `${environment.timeTrackerApiUrl}/time-entries`;
22-
@Input() showOptionInDevelopment: boolean;
22+
urlInProduction = environment.production;
2323

2424
loadActiveEntry(): Observable<any> {
2525
let path = '';
26-
if (this.showOptionInDevelopment){
26+
27+
if (this.urlInProduction){
2728
path = `${this.baseUrl}/running`;
2829
}else{
2930
path = `${this.baseUrl}/active/2`;

0 commit comments

Comments
 (0)