Skip to content

Commit

Permalink
Merge pull request #4965 from Cookiezaurs/master-user-merging
Browse files Browse the repository at this point in the history
[core] Fixes for views ommiting
  • Loading branch information
Cookiezaurs authored Mar 7, 2024
2 parents 8b127d8 + 82fbce0 commit 13bddf5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion plugins/views/api/jobs/cleanupMeta.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,12 @@ class CleanupMetaJob extends job.Job {
}
else {
let listToOmit = [];

if (view && view.segments) {
var omittedList = view.omit || [];
for (var key in view.segments) {
//console.log(key+" "+Object.keys(listed[z].segments[key]).length);
if (Object.keys(view.segments[key]).length > 100) {
if (omittedList.indexOf(key) !== -1) {
listToOmit.push(key);
}
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/views/api/parts/viewsUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.exports = {
}
var updateOp = {};
if (options.extend) {
updateOp = {$addToSet: {omit: omit}, "$unset": unset};
updateOp = {$addToSet: {omit: {"$each": omit}}, "$unset": unset};

}
else {
Expand Down

0 comments on commit 13bddf5

Please sign in to comment.