@mtgame/core 0.2.97 → 0.2.98

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,15 @@
1
1
  import { HttpClient } from '@angular/common/http';
2
2
  import { Team } from '../models/team';
3
+ import { ConfigService } from '../services/config.service';
3
4
  interface LeagueTeamFilters {
4
- tournament_id: number;
5
- tournament_season_id: number;
5
+ tournament_id?: number;
6
+ tournament_season_id?: number;
7
+ query?: string;
6
8
  }
7
9
  export declare class LeagueTeamApi {
8
10
  private httpClient;
9
- constructor(httpClient: HttpClient);
11
+ private configService;
12
+ constructor(httpClient: HttpClient, configService: ConfigService);
10
13
  getLeagueTeams(filters?: LeagueTeamFilters): Promise<Team[]>;
11
14
  getLeagueTeam(teamId: number): Promise<Team>;
12
15
  }
@@ -8799,8 +8799,9 @@
8799
8799
  ]; };
8800
8800
 
8801
8801
  var LeagueTeamApi = /** @class */ (function () {
8802
- function LeagueTeamApi(httpClient) {
8802
+ function LeagueTeamApi(httpClient, configService) {
8803
8803
  this.httpClient = httpClient;
8804
+ this.configService = configService;
8804
8805
  }
8805
8806
  LeagueTeamApi.prototype.getLeagueTeams = function (filters) {
8806
8807
  return __awaiter(this, void 0, void 0, function () {
@@ -8814,26 +8815,30 @@
8814
8815
  if (filters.tournament_season_id) {
8815
8816
  params = params.set('tournament_season_id', filters.tournament_season_id);
8816
8817
  }
8818
+ if (filters.query) {
8819
+ params = params.set('query', filters.query);
8820
+ }
8817
8821
  }
8818
- return [2 /*return*/, this.httpClient.get('/api/v1/league_team/', { params: params }).pipe(operators.map(function (response) { return response.map(function (item) { return exports.Team.toFront(item); }); })).toPromise()];
8822
+ return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/league_team/", { params: params }).pipe(operators.map(function (response) { return response.map(function (item) { return exports.Team.toFront(item); }); })).toPromise()];
8819
8823
  });
8820
8824
  });
8821
8825
  };
8822
8826
  LeagueTeamApi.prototype.getLeagueTeam = function (teamId) {
8823
8827
  return __awaiter(this, void 0, void 0, function () {
8824
8828
  return __generator(this, function (_a) {
8825
- return [2 /*return*/, this.httpClient.get("/api/v1/league_team/" + teamId + "/").pipe(operators.map(function (response) { return exports.Team.toFront(response); })).toPromise()];
8829
+ return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/league_team/" + teamId + "/").pipe(operators.map(function (response) { return exports.Team.toFront(response); })).toPromise()];
8826
8830
  });
8827
8831
  });
8828
8832
  };
8829
8833
  return LeagueTeamApi;
8830
8834
  }());
8831
- LeagueTeamApi.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function LeagueTeamApi_Factory() { return new LeagueTeamApi(i0__namespace.ɵɵinject(i1__namespace.HttpClient)); }, token: LeagueTeamApi, providedIn: "root" });
8835
+ LeagueTeamApi.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function LeagueTeamApi_Factory() { return new LeagueTeamApi(i0__namespace.ɵɵinject(i1__namespace.HttpClient), i0__namespace.ɵɵinject(ConfigService)); }, token: LeagueTeamApi, providedIn: "root" });
8832
8836
  LeagueTeamApi.decorators = [
8833
8837
  { type: i0.Injectable, args: [{ providedIn: 'root' },] }
8834
8838
  ];
8835
8839
  LeagueTeamApi.ctorParameters = function () { return [
8836
- { type: i1.HttpClient }
8840
+ { type: i1.HttpClient },
8841
+ { type: ConfigService }
8837
8842
  ]; };
8838
8843
 
8839
8844
  var MediaApi = /** @class */ (function () {