From 2903ce7aae3142cc00d4267f5916038ba6aeadc3 Mon Sep 17 00:00:00 2001 From: Jack Koppa Date: Wed, 29 Nov 2017 07:20:54 -0600 Subject: [PATCH] Rename OpenAQ locations models to match naming convention --- .../openaq/locations/locations-individual-response.model.ts | 2 +- src/app/core/api/openaq/locations/locations-response.model.ts | 4 ++-- src/app/core/api/openaq/locations/locations.api.ts | 4 ++-- src/app/core/handlers/locations-handler.service.ts | 4 ++-- src/app/search/search.component.ts | 4 ++-- src/app/search/search.service.ts | 2 +- src/app/search/searched-city.model.ts | 4 ++-- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/app/core/api/openaq/locations/locations-individual-response.model.ts b/src/app/core/api/openaq/locations/locations-individual-response.model.ts index 51fb87d..ba52063 100644 --- a/src/app/core/api/openaq/locations/locations-individual-response.model.ts +++ b/src/app/core/api/openaq/locations/locations-individual-response.model.ts @@ -2,7 +2,7 @@ import { CoordinatesModel } from '../coordinates.model'; import { Parameter } from '../parameter.model'; -export interface LocationsIndividualResponseModel { +export interface LocationsIndividualResponse { location: string; country: string; city: string; diff --git a/src/app/core/api/openaq/locations/locations-response.model.ts b/src/app/core/api/openaq/locations/locations-response.model.ts index 96c633d..f6ec9f9 100644 --- a/src/app/core/api/openaq/locations/locations-response.model.ts +++ b/src/app/core/api/openaq/locations/locations-response.model.ts @@ -1,4 +1,4 @@ // https://docs.openaq.org/#api-Locations -import { LocationsIndividualResponseModel } from './locations-individual-response.model'; +import { LocationsIndividualResponse } from './locations-individual-response.model'; -export interface LocationsResponseModel extends Array {} \ No newline at end of file +export interface LocationsResponse extends Array {} \ No newline at end of file diff --git a/src/app/core/api/openaq/locations/locations.api.ts b/src/app/core/api/openaq/locations/locations.api.ts index 61e387d..91df1ee 100644 --- a/src/app/core/api/openaq/locations/locations.api.ts +++ b/src/app/core/api/openaq/locations/locations.api.ts @@ -3,7 +3,7 @@ import { Injectable } from '@angular/core'; import { Http, RequestOptionsArgs, BaseRequestOptions } from '@angular/http'; import { LocationsRequest } from './locations-request.model'; -import { LocationsResponseModel } from './locations-response.model'; +import { LocationsResponse } from './locations-response.model'; import { ApiService } from '../../api.service'; import { environment } from '../../../../../environments/environment'; import 'rxjs/add/operator/map'; @@ -16,7 +16,7 @@ export class LocationsApi { private apiService: ApiService ) {} - public getLocations(request?: LocationsRequest): Observable { + public getLocations(request?: LocationsRequest): Observable { return this.http.get(environment.openaqApiUrl + 'locations?' + this.apiService.buildOpenAQQueryString(request)) .map(res => res.json().results); } diff --git a/src/app/core/handlers/locations-handler.service.ts b/src/app/core/handlers/locations-handler.service.ts index db6d06e..78e5cbd 100644 --- a/src/app/core/handlers/locations-handler.service.ts +++ b/src/app/core/handlers/locations-handler.service.ts @@ -1,14 +1,14 @@ import { Injectable } from '@angular/core'; import { LocationsApi } from '../api/openaq/locations/locations.api'; import { LocationsRequest } from '../api/openaq/locations/locations-request.model'; -import { LocationsResponseModel } from '../api/openaq/locations/locations-response.model'; +import { LocationsResponse } from '../api/openaq/locations/locations-response.model'; import { Observable } from 'rxjs/Observable'; @Injectable() export class LocationsHandlerService { constructor(private locationsApi: LocationsApi) {}; - getLocationsByCityAndCountry(cityName: string, country: string): Observable { + getLocationsByCityAndCountry(cityName: string, country: string): Observable { let request: LocationsRequest = { city: cityName, country: country diff --git a/src/app/search/search.component.ts b/src/app/search/search.component.ts index 23454d4..3a98327 100644 --- a/src/app/search/search.component.ts +++ b/src/app/search/search.component.ts @@ -9,7 +9,7 @@ import 'rxjs/add/operator/catch'; import { CitiesIndividualResponse } from '../core/api/openaq/cities/cities-individual-response.model'; import { CitiesResponse } from '../core/api/openaq/cities/cities-response.model'; import { LatestResponse } from '../core/api/openaq/latest/latest-response.model'; -import { LocationsResponseModel } from '../core/api/openaq/locations/locations-response.model'; +import { LocationsResponse } from '../core/api/openaq/locations/locations-response.model'; import { CityCardsListComponent } from '../city/city-cards-list.component'; import { LocationsHandlerService } from '../core/handlers/locations-handler.service'; import { MessagingService } from '../shared/messaging/messaging.service'; @@ -91,7 +91,7 @@ export class SearchComponent implements OnInit { }); } - private outputSearchedCity(city: CitiesIndividualResponse, locations: LocationsResponseModel): void { + private outputSearchedCity(city: CitiesIndividualResponse, locations: LocationsResponse): void { this.searching = false; this.clearSearchInput(); const searchedCity: SearchedCity = city; diff --git a/src/app/search/search.service.ts b/src/app/search/search.service.ts index 15f300f..1f46453 100644 --- a/src/app/search/search.service.ts +++ b/src/app/search/search.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@angular/core'; import { FormControl } from '@angular/forms'; import { CitiesResponse } from '../core/api/openaq/cities/cities-response.model'; -import { LocationsResponseModel } from '../core/api/openaq/locations/locations-response.model'; +import { LocationsResponse } from '../core/api/openaq/locations/locations-response.model'; import { Observable } from 'rxjs/Observable'; import { CitiesRequest } from '../core/api/openaq/cities/cities-request.model'; diff --git a/src/app/search/searched-city.model.ts b/src/app/search/searched-city.model.ts index 1a5d3e8..1e7a1f8 100644 --- a/src/app/search/searched-city.model.ts +++ b/src/app/search/searched-city.model.ts @@ -1,6 +1,6 @@ import { CitiesIndividualResponse } from '../core/api/openaq/cities/cities-individual-response.model'; -import { LocationsResponseModel } from '../core/api/openaq/locations/locations-response.model'; +import { LocationsResponse } from '../core/api/openaq/locations/locations-response.model'; export interface SearchedCity extends CitiesIndividualResponse { - locationsResponse?: LocationsResponseModel; + locationsResponse?: LocationsResponse; } \ No newline at end of file