Skip to content

Commit

Permalink
service migrated
Browse files Browse the repository at this point in the history
  • Loading branch information
az108 committed Dec 1, 2024
1 parent dece904 commit 43b8959
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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<EntityResponseType> {
return this.httpClient
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -9,9 +9,9 @@ type EntityResponseType = HttpResponse<TutorialGroupsConfiguration>;

@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
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -15,13 +15,11 @@ type EntityArrayResponseType = HttpResponse<TutorialGroup[]>;

@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<HttpResponse<string[]>> {
return this.httpClient.get<string[]>(`${this.resourceURL}/courses/${courseId}/tutorial-groups/campus-values`, { observe: 'response' });
Expand Down

0 comments on commit 43b8959

Please sign in to comment.