Lists list and CUD
Custom forms list Updated DB schema (not yet implemented in the server, which means that most of the server is not broken). - custom forms are independent of a list - order and visibility of fields is now in custom_fields - first_name and last_name has been turned to a regular custom field
This commit is contained in:
parent
216fe40b53
commit
f6e1938ff9
47 changed files with 1245 additions and 122 deletions
|
@ -7,7 +7,31 @@ const router = require('../../lib/router-async').create();
|
|||
|
||||
|
||||
router.postAsync('/lists-table', passport.loggedIn, async (req, res) => {
|
||||
return res.json(await lists.listDTAjax(req.body));
|
||||
return res.json(await lists.listDTAjax(req.context, req.body));
|
||||
});
|
||||
|
||||
router.getAsync('/lists/:listId', passport.loggedIn, async (req, res) => {
|
||||
const list = await lists.getById(req.context, req.params.listId);
|
||||
list.hash = lists.hash(list);
|
||||
return res.json(list);
|
||||
});
|
||||
|
||||
router.postAsync('/lists', passport.loggedIn, passport.csrfProtection, async (req, res) => {
|
||||
await lists.create(req.context, req.body);
|
||||
return res.json();
|
||||
});
|
||||
|
||||
router.putAsync('/lists/:listId', passport.loggedIn, passport.csrfProtection, async (req, res) => {
|
||||
const list = req.body;
|
||||
list.id = parseInt(req.params.listId);
|
||||
|
||||
await lists.updateWithConsistencyCheck(req.context, list);
|
||||
return res.json();
|
||||
});
|
||||
|
||||
router.deleteAsync('/lists/:listId', passport.loggedIn, passport.csrfProtection, async (req, res) => {
|
||||
await lists.remove(req.context, req.params.listId);
|
||||
return res.json();
|
||||
});
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue