...
Create a new file cmsbs-conf/cse/plugins/de.pinutsacme.tutorial/custom/removeSegmentFromList.mjs
:
Codeblock | ||
---|---|---|
| ||
de.acme.tutorial.removeSegmentFromList = (segmentName, listName) => {
const query = UM.query(`inChannel(${listName}) and inVChannel(${segmentName})`);
while (true) {
let entries = query.page(100, 0); // 100 per page, stay on page 0!
if (entries.length == 0) break;
entries.forEach(entry => {
entry.channels.unsubscribe(listName);
});
UM.commitEntries();
UM.test.emptyEntryCache();
}
} |
See also Some gotchas.
...