Added confirmations for unsubscribe, blacklist and remove from blacklist

This commit is contained in:
Tomas Bures 2018-11-22 11:31:16 +01:00
parent aeaaf116d7
commit b058169e12
25 changed files with 290 additions and 228 deletions

View file

@ -177,10 +177,6 @@ async function remove(context, id) {
await knex.transaction(async tx => {
await shares.enforceEntityPermissionTx(tx, context, 'list', id, 'delete');
await fields.removeAllByListIdTx(tx, context, id);
await segments.removeAllByListIdTx(tx, context, id);
await imports.removeAllByListIdTx(tx, context, id);
await dependencyHelpers.ensureNoDependencies(tx, context, id, [
{
entityTypeId: 'campaign',
@ -191,6 +187,10 @@ async function remove(context, id) {
}
]);
await fields.removeAllByListIdTx(tx, context, id);
await segments.removeAllByListIdTx(tx, context, id);
await imports.removeAllByListIdTx(tx, context, id);
await tx('lists').where('id', id).del();
await knex.schema.dropTableIfExists('subscription__' + id);
});