WiP updates
This commit is contained in:
parent
6706d93bc1
commit
4fce4b6f81
27 changed files with 763 additions and 85 deletions
|
@ -36,6 +36,7 @@ async function listDTAjax(context, params) {
|
|||
|
||||
async function _validateAndPreprocess(tx, entity) {
|
||||
entity.data = JSON.stringify(entity.data);
|
||||
await namespaceHelpers.validateEntity(tx, entity);
|
||||
}
|
||||
|
||||
async function create(context, entity) {
|
||||
|
@ -44,8 +45,6 @@ async function create(context, entity) {
|
|||
|
||||
await _validateAndPreprocess(tx, entity);
|
||||
|
||||
await namespaceHelpers.validateEntity(tx, entity);
|
||||
|
||||
const ids = await tx('mosaico_templates').insert(filterObject(entity, allowedKeys));
|
||||
const id = ids[0];
|
||||
|
||||
|
@ -74,7 +73,6 @@ async function updateWithConsistencyCheck(context, entity) {
|
|||
|
||||
await _validateAndPreprocess(tx, entity);
|
||||
|
||||
await namespaceHelpers.validateEntity(tx, entity);
|
||||
await namespaceHelpers.validateMove(context, entity, existing, 'mosaicoTemplate', 'createMosaicoTemplate', 'delete');
|
||||
|
||||
await tx('mosaico_templates').where('id', entity.id).update(filterObject(entity, allowedKeys));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue