mirror of
https://github.com/bellingcat/datasheet-server.git
synced 2026-06-11 04:48:32 +03:00
rename 'routes' in blueprints to 'resources'
routes was a confusing semantics that was not in order with the rest of the architecture
This commit is contained in:
@@ -25,7 +25,6 @@ class Controller {
|
||||
return this.fetchers[sheet].update()
|
||||
})
|
||||
).then(results => {
|
||||
console.log(results)
|
||||
if (results.every(r => r)) {
|
||||
return copy.success.update
|
||||
} else {
|
||||
|
||||
@@ -47,7 +47,10 @@ class Fetcher {
|
||||
* performance of indexing the blueprints.
|
||||
*/
|
||||
this.blueprints = this._indexDbForBlueprints()
|
||||
.then(res => res)
|
||||
.then(allUrls => {
|
||||
const supportedUrls = allUrls.filter(url => url.startsWith(this.id))
|
||||
return {}
|
||||
})
|
||||
|
||||
/*
|
||||
* Google API setup
|
||||
@@ -71,8 +74,8 @@ class Fetcher {
|
||||
)
|
||||
|
||||
return Promise.all(
|
||||
Object.keys(saturatedBp.routes).map(route =>
|
||||
this.db.save(`${this.id}/${tab}/${route}`, saturatedBp.routes[route].data)
|
||||
Object.keys(saturatedBp.resources).map(route =>
|
||||
this.db.save(`${this.id}/${tab}/${route}`, saturatedBp.resources[route].data)
|
||||
)
|
||||
)
|
||||
}
|
||||
@@ -106,7 +109,7 @@ class Fetcher {
|
||||
|
||||
update () {
|
||||
let tabTitles
|
||||
/* Retrieve all available routes on a given sheet, and store formatted copies of it where a formatter is available */
|
||||
/* Retrieve all available resources on a given sheet, and store formatted copies of it where a formatter is available */
|
||||
return this.API.spreadsheets
|
||||
.get({
|
||||
auth: this.auth,
|
||||
|
||||
@@ -5,7 +5,7 @@ export const defaultBlueprint = {
|
||||
name: null,
|
||||
id: null,
|
||||
dialects: ['rest'], // supported dialects, can (eventually) be multiple
|
||||
routes: {}
|
||||
resources: {}
|
||||
}
|
||||
|
||||
export const defaultRoute = {
|
||||
|
||||
@@ -77,11 +77,11 @@ export function desaturate (full) {
|
||||
name: R.clone(full.name),
|
||||
sheet: R.clone(full.sheet),
|
||||
dialects: R.clone(full.dialects),
|
||||
routes: {}
|
||||
resources: {}
|
||||
}
|
||||
Object.keys(full.routes).forEach(route => {
|
||||
blueprint.routes[route] = {
|
||||
options: R.clone(full.routes[route].options)
|
||||
Object.keys(full.resources).forEach(route => {
|
||||
blueprint.resources[route] = {
|
||||
options: R.clone(full.resources[route].options)
|
||||
}
|
||||
})
|
||||
return blueprint
|
||||
|
||||
Reference in New Issue
Block a user