mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-03 09:38:54 +00:00
c28604b891
The fresh lookup behind New place details goes through placeDetailsRepo (online-only, like the service identity) instead of api/ directly. The form loses the Translate type and the comment that moved with the head band's pills, which takes it under its line limit and out of the size baseline; the maps service suite's test-size entry follows its shorter count.
17 lines
676 B
TypeScript
17 lines
676 B
TypeScript
import { mapsApi } from '../api/client';
|
|
import { requireOnline } from './onlineOnly';
|
|
|
|
/**
|
|
* A provider's details of a place, looked up fresh (Google, the TREK index or
|
|
* OpenStreetMap, by the id the place carries). **Online-only, no Dexie table:**
|
|
* the point of asking is the current answer, and a cached one would offer the
|
|
* same values again as if they were new.
|
|
*/
|
|
export const placeDetailsRepo = {
|
|
async details(placeId: string, lang: string): Promise<Record<string, unknown> | null> {
|
|
requireOnline();
|
|
const answer = (await mapsApi.details(placeId, lang)) as { place?: Record<string, unknown> | null } | null;
|
|
return answer?.place ?? null;
|
|
},
|
|
};
|