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:
Lachlan Kermode
2018-12-07 12:02:40 +00:00
parent 5274ac887d
commit aff9b384d1
4 changed files with 81 additions and 53 deletions

View File

@@ -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),