Begining to implement a GPX Dialog component

This commit is contained in:
vdv committed 2022-12-12 11:41:09 +01:00
1 parent 31bec02496
commit 59faede004
11 files changed
+742 -108

No files matched your search

+17
View File
@@ -214,6 +214,23 @@ export const getAllGpxes = async () => {
}
};
export const getAllGpxesWithSummary = async () => {
const allGpxes = await getAllGpxes();
const result = await Promise.all(
allGpxes.map(async (id: string) => {
const gpxDoc = await get(id);
// console.log({ caller: 'getAllGpxesWithSummary', gpx: gpxDoc });
return {
id,
name: gpxDoc.doc.metadata?.name,
creator: gpxDoc.doc.$?.creator,
};
})
);
console.log({ caller: 'getAllGpxesWithSummary', result });
return result;
};
export const appendToArray = (target: any, key: string, value: any) => {
if (!(key in target)) {
target[key] = <any>[];