Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Revert "feat: TT-443 Use V2 for start timeEntry from timeClock (#777)"
This reverts commit ae78b6a.
  • Loading branch information
ararcos authored Dec 21, 2021
commit 3235b1f8d513614759918c034e4f8b3e97baf968
9 changes: 0 additions & 9 deletions src/app/modules/time-clock/services/entry.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,12 @@ describe('EntryService', () => {
});

it('loads an activeEntry with /running', () => {
service.showOptionInDevelopment = true;
service.loadActiveEntry().subscribe();

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

it('loads an activeEntry with /active/{userId}', () => {
service.showOptionInDevelopment = false;
service.loadActiveEntry().subscribe();

const loadEntryRequest = httpMock.expectOne(`${service.baseUrl}/active/2`);
expect(loadEntryRequest.request.method).toBe('GET');
});

it('loads summary with get /summary?time_offset=<time-offset>', () => {
service.summary().subscribe();
const timeOffset = new Date().getTimezoneOffset();
Expand Down
11 changes: 2 additions & 9 deletions src/app/modules/time-clock/services/entry.service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { TimeEntriesSummary } from '../models/time.entry.summary';
import { Injectable, Input } from '@angular/core';
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';

import { Observable } from 'rxjs';
Expand All @@ -19,16 +19,9 @@ export class EntryService {

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

loadActiveEntry(): Observable<any> {
let path = '';
if (this.showOptionInDevelopment){
path = `${this.baseUrl}/running`;
}else{
path = `${this.baseUrl}/active/2`;
}
return this.http.get(path);
return this.http.get(`${this.baseUrl}/running`);
}

loadEntries(date): Observable<any> {
Expand Down