mirror of
https://github.com/bellingcat/datasheet-server.git
synced 2026-06-10 20:38:32 +03:00
fix differential args for fetchers
This commit is contained in:
@@ -15,10 +15,15 @@ export default callback => {
|
||||
// skip config attrs that don't have corresponding fetchers
|
||||
if (!(fType in fetchers)) return null
|
||||
const FFetcher = fetchers[fType]
|
||||
return config[fType].map(sheet => ({
|
||||
name: sheet.name,
|
||||
fetcher: new FFetcher(new StoreJson(), ...Object.values(sheet))
|
||||
}))
|
||||
return config[fType].map(sheet => {
|
||||
const otherArgs = { ...sheet }
|
||||
delete otherArgs.name
|
||||
delete otherArgs.tabs
|
||||
return {
|
||||
name: sheet.name,
|
||||
fetcher: new FFetcher(new StoreJson(), sheet.name, sheet.tabs, ...Object.values(otherArgs))
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
.then(res => {
|
||||
|
||||
@@ -22,7 +22,6 @@ class Controller {
|
||||
update () {
|
||||
return Promise.all(
|
||||
Object.keys(this.fetchers).map(sheet => {
|
||||
console.log(sheet)
|
||||
return this.fetchers[sheet].update()
|
||||
})
|
||||
).then(results => {
|
||||
|
||||
@@ -1,18 +1,24 @@
|
||||
import BP from './lib/blueprinters'
|
||||
|
||||
const timemapStructure = {
|
||||
teuruwera_export_events: BP.deeprows,
|
||||
teuruwera_export_categories: [BP.groups, BP.rows],
|
||||
export_events: BP.deeprows,
|
||||
export_categories: [BP.groups, BP.rows],
|
||||
export_narratives: BP.rows,
|
||||
teuruwera_export_sources: BP.deepids,
|
||||
export_sources: BP.deepids,
|
||||
export_sites: BP.rows,
|
||||
export_tags: BP.tree
|
||||
}
|
||||
|
||||
export default {
|
||||
gsheets: [{
|
||||
name: 'example',
|
||||
id: '1UC7DkCFeUXHfpUxUGruExwFbP4pqVBdJLOKfo6wDDGk',
|
||||
tabs: timemapStructure
|
||||
name: 'nzacts',
|
||||
tabs: timemapStructure,
|
||||
id: '1ej3kEtANGYsEBUCTfWsIR0UhTSJIuXFHLYspti2sgHo'
|
||||
}],
|
||||
|
||||
xlsx: [{
|
||||
name: 'morocco_pushbacks',
|
||||
tabs: timemapStructure,
|
||||
path: 'temp/morocco_pushbacks.xlsx'
|
||||
}]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user