feature (admin): admin console

This commit is contained in:
Mickael KERJEAN
2018-12-07 12:54:28 +11:00
parent 1b591af5b3
commit ce6a228968
78 changed files with 2699 additions and 386 deletions

16
client/helpers/form.js Normal file
View File

@ -0,0 +1,16 @@
export const FormObjToJSON = function(o, fn){
let obj = Object.assign({}, o);
Object.keys(obj).map((key) => {
let t = obj[key];
if("label" in t && "type" in t && "default" in t && "value" in t){
if(typeof fn === "function"){
fn(obj, key);
} else {
obj[key] = obj[key].value;
}
} else {
obj[key] = FormObjToJSON(obj[key], fn);
}
});
return obj
};