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