fix: format api data correctly

This commit is contained in:
2018-11-02 14:52:23 -07:00
parent 7857830d35
commit 6def9449be

View File

@@ -23,8 +23,8 @@ export default async function(indexName, opts = {}) {
// index all the data
const documents = records.map(rec => ({
transponder: rec[0],
callsign: rec[1],
transponder: `${rec[0]}`.toLowerCase(),
callsign: `${rec[1]}`.trim(),
origin_country: rec[2],
time_position: new Date(rec[3] * 1000),
last_contact: new Date(rec[4] * 1000),