Paginator & SQL Querries where clauses & city search

This commit is contained in:
2024-07-18 19:02:32 +02:00
parent f88eebe8d3
commit abcde3991d
30 changed files with 850 additions and 421 deletions

View File

@@ -1,18 +1,18 @@
import { Injectable } from '@angular/core';
import { environment } from '../../environments/environment';
import { Observable } from 'rxjs';
import { HttpClient } from '@angular/common/http';
export interface GeoResult { city: string; state: string; state_code: string }
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { GeoResult } from '../../../../bizmatch-server/src/models/main.model';
import { environment } from '../../environments/environment';
@Injectable({
providedIn: 'root'
providedIn: 'root',
})
export class GeoService {
private apiBaseUrl = environment.apiBaseUrl;
constructor(private http: HttpClient) { }
constructor(private http: HttpClient) {}
findCitiesStartingWith(prefix:string, state?:string):Observable<GeoResult[]>{
const stateString = state?`/${state}`:''
findCitiesStartingWith(prefix: string, state?: string): Observable<GeoResult[]> {
const stateString = state ? `/${state}` : '';
return this.http.get<GeoResult[]>(`${this.apiBaseUrl}/bizmatch/geo/${prefix}${stateString}`);
}
}