mirror of
https://github.com/bellingcat/datasheet-server.git
synced 2026-06-12 13:28:32 +03:00
fix ids blueprinter
This commit is contained in:
@@ -32,11 +32,12 @@ export default function ids (
|
|||||||
const itemLabels = data[0]
|
const itemLabels = data[0]
|
||||||
const fmt = fmtObj(itemLabels)
|
const fmt = fmtObj(itemLabels)
|
||||||
bp.resources[label] = R.clone(defaultResource)
|
bp.resources[label] = R.clone(defaultResource)
|
||||||
bp.resources[label].data = []
|
bp.resources[label].data = {}
|
||||||
|
|
||||||
data.forEach((row, idx) => {
|
data.forEach((row, idx) => {
|
||||||
if (idx === 0) return
|
if (idx === 0) return
|
||||||
bp.resources[label].data[fmt(row).id] = fmt(row)
|
bp.resources[label].data[fmt(row).id] = fmt(row)
|
||||||
})
|
})
|
||||||
|
|
||||||
return bp
|
return bp
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,8 @@ export const fmtObj = R.curry(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
columnNames.forEach((columnName, idx) => {
|
columnNames.forEach((columnName, idx) => {
|
||||||
obj[fmtColName(columnName)] = row[idx]
|
const value = row[idx] ? row[idx] : ""
|
||||||
|
obj[fmtColName(columnName)] = value
|
||||||
})
|
})
|
||||||
return obj
|
return obj
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user