This commit is contained in:
vdv committed 2022-10-04 11:18:22 +02:00
1 parent 2376d4daba
commit 330b4bb721
8 files changed
+13 -15

No files matched your search

+2 -3
View File
@@ -49,13 +49,11 @@ export const pushGpx = async (db: any, payload: any) => {
for (var point in points) {
const docPoint = { type: 'trkpt', gpx: _id, trkpt: points[point] };
console.log(JSON.stringify(docPoint));
const response = await db.post(docPoint);
await db.post(docPoint);
console.log(JSON.stringify(docPoint));
}
};
const CURRENT_GPX = '---current gpx---';
const initialGpx = {
type: 'gpx',
subtype: 'current',
@@ -187,6 +185,7 @@ export const getGpx = async (db: any, gpxId: string) => {
);
trkpts.map((trkptDoc: any) => {
gpx.trk[0].trkseg[0].trkpt.push(trkptDoc.trkpt);
return undefined;
});
return gpx;
};
+2 -2
View File
@@ -1,4 +1,4 @@
import _, { constant } from 'lodash';
import _ from 'lodash';
import uri from '../lib/ids';
const dbDefinitionId = uri('dbdef', {});
@@ -74,7 +74,7 @@ export const initDb = async (db: any, setDbReady: any) => {
}
}
for (var index of requiredIndexes) {
for (index of requiredIndexes) {
if (!findIndex(existingIndexes, index)) {
// console.log(`db.createIndex(${JSON.stringify(index)})`);
await db.createIndex({ name: index.name, ...index.def });