mirror of
https://github.com/myfatemi04/wheelshare-frontend.git
synced 2025-04-20 10:50:16 -04:00
20 lines
395 B
TypeScript
20 lines
395 B
TypeScript
export type PlaceDetails = {
|
|
formattedAddress: string;
|
|
latitude: number;
|
|
longitude: number;
|
|
};
|
|
|
|
export async function getPlaceDetails(
|
|
placeId: string
|
|
): Promise<PlaceDetails | null> {
|
|
if (placeId == null) {
|
|
console.warn('placeId was null');
|
|
return null;
|
|
}
|
|
|
|
const result = await fetch('http://localhost:5000/api/place/' + placeId);
|
|
const json = await result.json();
|
|
|
|
return json;
|
|
}
|