mirror of
https://github.com/bellingcat/datasheet-server.git
synced 2026-06-12 05:18:31 +03:00
better saving schema for model layer
previously, the model layer had a confused interface, where it saved via blueprints, but loaded via a URL logic. This commit modifies Fetchers to save consistently via a URL
This commit is contained in:
@@ -55,24 +55,24 @@ export const idxSearcher = R.curry((attrName, searchValue, myArray) => {
|
||||
|
||||
/* more site specific functions. TODO: maybe move to another folder? */
|
||||
|
||||
export function fmtSheetTitle (name) {
|
||||
export function fmtName (name) {
|
||||
return name.replaceAll(' ', '-').toLowerCase()
|
||||
}
|
||||
|
||||
export function fmtBlueprinterTitles (tabs) {
|
||||
const obj = {}
|
||||
Object.keys(tabs).forEach(tab => {
|
||||
const name = fmtSheetTitle(tab)
|
||||
const name = fmtName(tab)
|
||||
obj[name] = tabs[tab]
|
||||
})
|
||||
return obj
|
||||
}
|
||||
|
||||
export function deriveFilename (sheet, tab) {
|
||||
return `${fmtSheetTitle(sheet)}-${fmtSheetTitle(tab)}.json`
|
||||
return `${fmtName(sheet)}-${fmtName(tab)}.json`
|
||||
}
|
||||
|
||||
export function bp (full) {
|
||||
export function desaturate (full) {
|
||||
const blueprint = {
|
||||
name: R.clone(full.name),
|
||||
sheet: R.clone(full.sheet),
|
||||
|
||||
Reference in New Issue
Block a user