Namespace filtering when create/edit campaigns
This commit is contained in:
parent
7b08e2e97b
commit
74fe5e73e2
6 changed files with 752 additions and 9 deletions
|
@ -53,7 +53,7 @@ async function listDTAjax(context, params) {
|
|||
);
|
||||
}
|
||||
|
||||
async function listByNamespaceDTAjax(context, params) {
|
||||
async function listByNamespaceDTAjax(context, namespaceId, params) {
|
||||
const campaignEntityType = entitySettings.getEntityType('campaign');
|
||||
|
||||
return await dtHelpers.ajaxListWithPermissions(
|
||||
|
@ -62,7 +62,8 @@ async function listByNamespaceDTAjax(context, params) {
|
|||
params,
|
||||
builder => builder
|
||||
.from('lists')
|
||||
.innerJoin('namespaces', 'namespaces.id', 'lists.namespace'),
|
||||
.innerJoin('namespaces', 'namespaces.id', 'lists.namespace')
|
||||
.where('lists.namespace', namespaceId),
|
||||
['lists.id', 'lists.name', 'lists.cid', 'lists.subscribers', 'lists.description', 'namespaces.name',
|
||||
{
|
||||
name: 'triggerCount',
|
||||
|
|
|
@ -34,6 +34,19 @@ async function listDTAjax(context, params) {
|
|||
);
|
||||
}
|
||||
|
||||
async function listDTAjaxByNamespace(context, namespaceId, params) {
|
||||
return await dtHelpers.ajaxListWithPermissions(
|
||||
context,
|
||||
[{ entityTypeId: 'sendConfiguration', requiredOperations: ['viewPublic'] }],
|
||||
params,
|
||||
builder => builder
|
||||
.from('send_configurations')
|
||||
.innerJoin('namespaces', 'namespaces.id', 'send_configurations.namespace')
|
||||
.where('send_configurations.namespace', namespaceId),
|
||||
['send_configurations.id', 'send_configurations.name', 'send_configurations.cid', 'send_configurations.description', 'send_configurations.mailer_type', 'send_configurations.created', 'namespaces.name']
|
||||
);
|
||||
}
|
||||
|
||||
async function listWithSendPermissionDTAjax(context, params) {
|
||||
return await dtHelpers.ajaxListWithPermissions(
|
||||
context,
|
||||
|
@ -175,6 +188,7 @@ async function getSystemSendConfiguration() {
|
|||
|
||||
module.exports.hash = hash;
|
||||
module.exports.listDTAjax = listDTAjax;
|
||||
module.exports.listDTAjaxByNamespace = listDTAjaxByNamespace;
|
||||
module.exports.listWithSendPermissionDTAjax = listWithSendPermissionDTAjax;
|
||||
module.exports.getByIdTx = getByIdTx;
|
||||
module.exports.getById = getById;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue