Skip to content

Commit

Permalink
fix(lolapi): static endpoint incorrect
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveVanOpstal committed Mar 22, 2017
1 parent bcddcf2 commit dd8b872
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions src/client/services/lolapi.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,16 +137,14 @@ describe('LolApiService', () => {

it('should get the correct resolved link to the static-server',
inject([LolApiService], (service) => {
expect(service.getEndpoint(Endpoint.static, 'region'))
.toBe(
'https://' + settings.domain + '/staticapi/static-data/region/v1.2');
expect(service.getEndpoint(Endpoint.static, 'static-data', 'region'))
.toBe('https://' + settings.domain + '/staticapi/static-data/region/v1.2');
}));

it('should get the correct resolved link to the match-server',
inject([LolApiService], (service) => {
expect(service.getEndpoint(Endpoint.match, 'region'))
.toBe(
'https://' + settings.domain + '/matchapi/region');
expect(service.getEndpoint(Endpoint.match, 'static-data', 'region'))
.toBe('https://' + settings.domain + '/matchapi/region');
}));

it('should not get incorrect params', inject([LolApiService], (service) => {
Expand Down
2 changes: 1 addition & 1 deletion src/client/services/lolapi.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export class LolApiService {
private getEndpoint(endpoint: Endpoint, api: string, region: string): string {
switch (endpoint) {
case Endpoint.static:
return 'https://' + settings.domain + '/staticapi/' + api + '/' + region +
return 'https://' + settings.domain + '/staticapi/' + api + '/' + region + '/' +
settings.apiVersions[api];
default:
return 'https://' + settings.domain + '/matchapi/' + region;
Expand Down

0 comments on commit dd8b872

Please sign in to comment.