geo coding, user service, listing for business

This commit is contained in:
2024-03-10 20:59:23 +01:00
parent 06f349d1c3
commit 6ad40b6dca
59 changed files with 120466 additions and 687 deletions

View File

@@ -0,0 +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 }
@Injectable({
providedIn: 'root'
})
export class GeoService {
private apiBaseUrl = environment.apiBaseUrl;
constructor(private http: HttpClient) { }
findCitiesStartingWith(prefix:string, state?:string):Observable<GeoResult[]>{
const stateString = state?`/${state}`:''
return this.http.get<GeoResult[]>(`${this.apiBaseUrl}/bizmatch/geo/${prefix}${stateString}`);
}
}