Last active
October 4, 2016 15:14
-
-
Save solisoft/6d241d0a9f3e1a8f7a997392f89135b1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var loadFields = function() { | |
// { r: new_row, c: classname, n: name/id, t: type, j: joi validation, l: label, d: data list } | |
fields = [ | |
{ r: true, c: "1-1", n: "title", t: "string", j: joi.string().required(), l: "Title" }, | |
{ r: true, c: "1-2", n: "date", t: "date", j: joi.string().required(), l: "Publishing Date" }, | |
{ r: false, c: "1-2", n: "draft", t: "list", j: joi.string().required(), l: "Draft?", d: [["y", "Yes"], ["n", "No"]] }, | |
{ r: true, c: "1-1", n: "text", t: "text", j: joi.string().required(), l: "Text"} | |
] | |
schema = {} | |
each(fields, function(f) { | |
schema[f.n] = f.j | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment