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