Pull apart settings module

This commit is contained in:
Julia Friesel
2018-09-13 19:05:06 +02:00
parent 3c1653bc8c
commit 88fc3cad09
10 changed files with 317 additions and 286 deletions
+2 -1
View File
@@ -1,9 +1,10 @@
import { schema } from '../../db'
import { getSchema } from '../../db'
export default function getColumnNamesForCsv() {
return getPrefixedKeys('CycleDay')
function getPrefixedKeys(schemaName, prefix) {
const schema = getSchema()
const model = schema[schemaName]
return Object.keys(model).reduce((acc, key) => {
const prefixedKey = prefix ? [prefix, key].join('.') : key