First attempt on campaign editing. Misses attachments. Untested.
This commit is contained in:
parent
ee786bc8ad
commit
0e0fb944e3
26 changed files with 1244 additions and 233 deletions
|
@ -40,6 +40,10 @@ async function listDTAjax(context, params) {
|
|||
}
|
||||
|
||||
async function _validateAndPreprocess(tx, entity) {
|
||||
await namespaceHelpers.validateEntity(tx, entity);
|
||||
|
||||
// We don't check contents of the "data" because it is processed solely on the client. The client generates the HTML code we use when sending out campaigns.
|
||||
|
||||
entity.data = JSON.stringify(entity.data);
|
||||
}
|
||||
|
||||
|
@ -49,8 +53,6 @@ async function create(context, entity) {
|
|||
|
||||
await _validateAndPreprocess(tx, entity);
|
||||
|
||||
await namespaceHelpers.validateEntity(tx, entity);
|
||||
|
||||
const ids = await tx('templates').insert(filterObject(entity, allowedKeys));
|
||||
const id = ids[0];
|
||||
|
||||
|
@ -78,7 +80,6 @@ async function updateWithConsistencyCheck(context, entity) {
|
|||
|
||||
await _validateAndPreprocess(tx, entity);
|
||||
|
||||
await namespaceHelpers.validateEntity(tx, entity);
|
||||
await namespaceHelpers.validateMove(context, entity, existing, 'template', 'createTemplate', 'delete');
|
||||
|
||||
await tx('templates').where('id', entity.id).update(filterObject(entity, allowedKeys));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue