Last active
July 17, 2017 09:29
-
-
Save scorredoira/a38e80af33c623e6795b8608e673af42 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
import "lib/std"; | |
import * as web from "lib/web"; | |
import * as orm from "lib/orm"; | |
import * as crud from "lib/crud"; | |
function init() { | |
initEntities(); | |
web.addRoute("/crm/clients.json", crud.listHandler("client"), [web.adminFilter]) | |
web.addRoute("/crm/clients/:id.json", crud.detailHandler("client"), [web.adminFilter]) | |
web.addRoute("/crm/saveClient.json", crud.saveHandler("client"), [web.adminFilter]) | |
} | |
function initEntities() { | |
orm.register({ | |
name: "client", | |
columns: ["id", "name", "lastName", "barcode"], | |
properties: [ | |
{ name: "name", type: "string", label: "@@Nombre" }, | |
{ name: "email", type: "email", label: "@@Email", nullable: true } | |
] | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment