Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
refactor: change endpoints route
  • Loading branch information
Nicole Garcia committed Feb 28, 2023
commit 9af4e4b936fdd9b8ea5635a911cb8ee350a3dfd3
Binary file modified .dev.env
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class ProjectService {
}

getRecentProjects(): Observable<Project[]> {
return this.http.get<Project[]>(`${this.url}/recent`);
return this.http.get<Project[]>(`${this.url}/recent/`);
}

createProject(projectData): Observable<any> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class InjectTokenInterceptor implements HttpInterceptor {
const token = this.isProduction ? this.azureAdB2CService.getBearerToken() : this.loginService.getBearerToken();
const requestWithHeaders = request.clone(
{
headers: request.headers.set('Authorization',
headers: request.headers.set('token',
'Bearer ' + token)
});
return next.handle(requestWithHeaders)
Expand Down
8 changes: 4 additions & 4 deletions src/app/modules/time-clock/services/entry.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class EntryService {
urlInProductionLegacy = environment.production === EnvironmentType.TT_PROD_LEGACY;

loadActiveEntry(): Observable<any> {
return this.http.get(`${this.baseUrl}/running`);
return this.http.get(`${this.baseUrl}/running/`);
}

loadEntries(date): Observable<any> {
Expand All @@ -47,7 +47,7 @@ export class EntryService {

stopEntryRunning(idEntry: string): Observable<any> {
return (this.urlInProductionLegacy ?
this.http.post(`${this.baseUrl}/${idEntry}/stop`, null) : this.http.put(`${this.baseUrl}/stop`, null) );
this.http.post(`${this.baseUrl}/${idEntry}/stop/`, null) : this.http.put(`${this.baseUrl}/stop/`, null) );
}

restartEntry(idEntry: string): Observable<Entry> {
Expand All @@ -57,7 +57,7 @@ export class EntryService {

summary(): Observable<TimeEntriesSummary> {
const timeOffset = new Date().getTimezoneOffset();
const summaryUrl = `${this.baseUrl}/summary?time_offset=${timeOffset}`;
const summaryUrl = `${this.baseUrl}/summary/?time_offset=${timeOffset}`;
return this.http.get<TimeEntriesSummary>(summaryUrl);
}

Expand All @@ -70,7 +70,7 @@ export class EntryService {

loadEntriesByTimeRange(range: TimeEntriesTimeRange, userId: string): Observable<any> {
const MAX_NUMBER_OF_ENTRIES_FOR_REPORTS = 9999;
const loadEntriesByTimeRangeURL = this.urlInProductionLegacy ? this.baseUrl : this.baseUrl + '/report';
const loadEntriesByTimeRangeURL = this.urlInProductionLegacy ? this.baseUrl : this.baseUrl + '/report/';
return this.http.get(loadEntriesByTimeRangeURL,
{
params: {
Expand Down