diff --git a/src/main/webapp/app/course/tutorial-groups/services/tutorial-group-free-period.service.ts b/src/main/webapp/app/course/tutorial-groups/services/tutorial-group-free-period.service.ts index fb56af637fad..ab3043e2a722 100644 --- a/src/main/webapp/app/course/tutorial-groups/services/tutorial-group-free-period.service.ts +++ b/src/main/webapp/app/course/tutorial-groups/services/tutorial-group-free-period.service.ts @@ -1,5 +1,5 @@ import { HttpClient, HttpResponse } from '@angular/common/http'; -import { Injectable } from '@angular/core'; +import { Injectable, inject } from '@angular/core'; import { Observable } from 'rxjs'; import { convertDateFromServer, toISO8601DateTimeString } from 'app/utils/date.utils'; import { map } from 'rxjs/operators'; @@ -15,9 +15,9 @@ export class TutorialGroupFreePeriodDTO { @Injectable({ providedIn: 'root' }) export class TutorialGroupFreePeriodService { - private resourceURL = 'api'; + private httpClient = inject(HttpClient); - constructor(private httpClient: HttpClient) {} + private resourceURL = 'api'; getOneOfConfiguration(courseId: number, tutorialGroupsConfigurationId: number, tutorialGroupFreePeriodId: number): Observable { return this.httpClient diff --git a/src/main/webapp/app/course/tutorial-groups/services/tutorial-group-session.service.ts b/src/main/webapp/app/course/tutorial-groups/services/tutorial-group-session.service.ts index 122a98d6ac52..2f37f5e24ff1 100644 --- a/src/main/webapp/app/course/tutorial-groups/services/tutorial-group-session.service.ts +++ b/src/main/webapp/app/course/tutorial-groups/services/tutorial-group-session.service.ts @@ -1,5 +1,5 @@ import { HttpClient, HttpParams, HttpResponse } from '@angular/common/http'; -import { Injectable } from '@angular/core'; +import { Injectable, inject } from '@angular/core'; import { Observable } from 'rxjs'; import { convertDateFromServer, toISO8601DateString } from 'app/utils/date.utils'; import { map } from 'rxjs/operators'; @@ -17,12 +17,10 @@ export class TutorialGroupSessionDTO { @Injectable({ providedIn: 'root' }) export class TutorialGroupSessionService { - private resourceURL = 'api'; + private httpClient = inject(HttpClient); + private tutorialGroupFreePeriodService = inject(TutorialGroupFreePeriodService); - constructor( - private httpClient: HttpClient, - private tutorialGroupFreePeriodService: TutorialGroupFreePeriodService, - ) {} + private resourceURL = 'api'; getOneOfTutorialGroup(courseId: number, tutorialGroupId: number, sessionId: number) { return this.httpClient diff --git a/src/main/webapp/app/course/tutorial-groups/services/tutorial-groups-configuration.service.ts b/src/main/webapp/app/course/tutorial-groups/services/tutorial-groups-configuration.service.ts index 96e1d60af650..086122602ae1 100644 --- a/src/main/webapp/app/course/tutorial-groups/services/tutorial-groups-configuration.service.ts +++ b/src/main/webapp/app/course/tutorial-groups/services/tutorial-groups-configuration.service.ts @@ -1,5 +1,5 @@ import { HttpClient, HttpResponse } from '@angular/common/http'; -import { Injectable } from '@angular/core'; +import { Injectable, inject } from '@angular/core'; import { Observable } from 'rxjs'; import { convertDateFromServer, toISO8601DateString } from 'app/utils/date.utils'; import { map } from 'rxjs/operators'; @@ -9,9 +9,9 @@ type EntityResponseType = HttpResponse; @Injectable({ providedIn: 'root' }) export class TutorialGroupsConfigurationService { - private resourceURL = 'api'; + private httpClient = inject(HttpClient); - constructor(private httpClient: HttpClient) {} + private resourceURL = 'api'; getOneOfCourse(courseId: number) { return this.httpClient diff --git a/src/main/webapp/app/course/tutorial-groups/services/tutorial-groups.service.ts b/src/main/webapp/app/course/tutorial-groups/services/tutorial-groups.service.ts index e011c4915199..e51341988010 100644 --- a/src/main/webapp/app/course/tutorial-groups/services/tutorial-groups.service.ts +++ b/src/main/webapp/app/course/tutorial-groups/services/tutorial-groups.service.ts @@ -1,5 +1,5 @@ import { HttpClient, HttpResponse } from '@angular/common/http'; -import { Injectable } from '@angular/core'; +import { Injectable, inject } from '@angular/core'; import { TutorialGroup } from 'app/entities/tutorial-group/tutorial-group.model'; import { Observable } from 'rxjs'; import { StudentDTO } from 'app/entities/student-dto.model'; @@ -15,13 +15,11 @@ type EntityArrayResponseType = HttpResponse; @Injectable({ providedIn: 'root' }) export class TutorialGroupsService { - private resourceURL = 'api'; + private httpClient = inject(HttpClient); + private tutorialGroupSessionService = inject(TutorialGroupSessionService); + private tutorialGroupsConfigurationService = inject(TutorialGroupsConfigurationService); - constructor( - private httpClient: HttpClient, - private tutorialGroupSessionService: TutorialGroupSessionService, - private tutorialGroupsConfigurationService: TutorialGroupsConfigurationService, - ) {} + private resourceURL = 'api'; getUniqueCampusValues(courseId: number): Observable> { return this.httpClient.get(`${this.resourceURL}/courses/${courseId}/tutorial-groups/campus-values`, { observe: 'response' });