fix gnss timestamp
This commit is contained in:
@ -51,14 +51,14 @@ router.post(
|
||||
)?.measurementValue,
|
||||
};
|
||||
|
||||
const gnssMetadata = message.uplink_message.decoded_payload?.messages[0].find(
|
||||
(e) => e.type === "Latitude"
|
||||
);
|
||||
|
||||
const gnssTimestamp = {
|
||||
timestamp: message.uplink_message.decoded_payload?.messages[0].find(
|
||||
(e) => e.type === "Latitude"
|
||||
)?.timestamp
|
||||
timestamp: gnssMetadata?.timestamp ? new Date(gnssMetadata.timestamp) : undefined
|
||||
};
|
||||
|
||||
|
||||
|
||||
const wifiScans =
|
||||
message.uplink_message.decoded_payload?.messages[0]
|
||||
.find((e) => e.type === "Wi-Fi Scan")
|
||||
@ -102,13 +102,12 @@ router.post(
|
||||
gnss:
|
||||
gnnsLocation.latitude && gnnsLocation.longitude
|
||||
? {
|
||||
latitude: gnnsLocation.latitude,
|
||||
longitude: gnnsLocation.longitude,
|
||||
latitude: gnnsLocation.latitude,
|
||||
longitude: gnnsLocation.longitude,
|
||||
|
||||
}
|
||||
}
|
||||
: undefined,
|
||||
|
||||
gnss_timestamp: new Date(gnssTimestamp.timestamp),
|
||||
gnss_timestamp: gnssTimestamp.timestamp,
|
||||
});
|
||||
};
|
||||
createDatabaseEntries().then();
|
||||
|
Reference in New Issue
Block a user