GpxDialog (looking good).

This commit is contained in:
vdv committed 2022-12-12 18:55:14 +01:00
1 parent 7df0b41260
commit 6da10713a0
7 files changed
+127 -10

No files matched your search

+23 -1
View File
@@ -219,7 +219,7 @@ export const getAllGpxesWithSummary = async () => {
const result = await Promise.all(
allGpxes.map(async (id: string) => {
const gpxDoc = await get(id);
// console.log({ caller: 'getAllGpxesWithSummary', gpx: gpxDoc });
// console.log({ caller: 'getAllGpxesWithSummary', gpx: gpxDoc });
return {
id,
name: gpxDoc.doc.metadata?.name,
@@ -304,3 +304,25 @@ export const getGpx = async (params: any) => {
});
return gpx;
};
export const putGpx = async (params: any) => {
const { id, gpx } = params;
const extensions = gpx?.extensions;
gpx.extensions = undefined;
gpx.wpt = undefined;
gpx.trk = undefined;
gpx.rte = undefined;
await put(id, 'gpx', (doc) => gpx, gpx);
if (extensions !== undefined) {
await put(
`${id}/4extensions`,
'extensions',
(doc) => extensions,
extensions
);
}
return id;
};