itlab-internal-services 2.16.6 → 2.16.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -40,14 +40,11 @@ async function populateLikedBy(options, items, accountsService) {
|
|
|
40
40
|
}
|
|
41
41
|
items.forEach((item) => {
|
|
42
42
|
item.likes = Math.max(item._likedBy.length, item.likes); // TODO: Tmp Fix
|
|
43
|
-
if (!options.includeLikedBy)
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
if (!(options.includeLikedBy || options.includeLikedByIds)) {
|
|
50
|
-
delete item.likes;
|
|
51
|
-
}
|
|
43
|
+
if (!options.includeLikedBy)
|
|
44
|
+
item.likedBy = undefined;
|
|
45
|
+
if (!options.includeLikedByIds)
|
|
46
|
+
item._likedBy = undefined;
|
|
47
|
+
if (!(options.includeLikedBy || options.includeLikedByIds))
|
|
48
|
+
item.likes = undefined;
|
|
52
49
|
});
|
|
53
50
|
}
|
|
@@ -30,9 +30,11 @@ function TimestampsOptions(Base, options) {
|
|
|
30
30
|
function populateTimestamps(options, items, additionalKeys = []) {
|
|
31
31
|
if (!options.includeTimestamps) {
|
|
32
32
|
items.forEach((item) => {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
additionalKeys.forEach((key) =>
|
|
33
|
+
item.createdAt = undefined;
|
|
34
|
+
item.updatedAt = undefined;
|
|
35
|
+
additionalKeys.forEach((key) => {
|
|
36
|
+
item[key] = undefined;
|
|
37
|
+
});
|
|
36
38
|
});
|
|
37
39
|
}
|
|
38
40
|
}
|
|
@@ -49,14 +49,11 @@ async function populateViewedBy(options, items, accountsService) {
|
|
|
49
49
|
}
|
|
50
50
|
items.forEach((item) => {
|
|
51
51
|
item.views = Math.max(item._viewedBy.length, item.views); // TODO: Tmp Fix
|
|
52
|
-
if (!options.includeViewedBy)
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
if (!(options.includeViewedBy || options.includeViewedByIds)) {
|
|
59
|
-
delete item.views;
|
|
60
|
-
}
|
|
52
|
+
if (!options.includeViewedBy)
|
|
53
|
+
item.viewedBy = undefined;
|
|
54
|
+
if (!options.includeViewedByIds)
|
|
55
|
+
item._viewedBy = undefined;
|
|
56
|
+
if (!(options.includeViewedBy || options.includeViewedByIds))
|
|
57
|
+
item.views = undefined;
|
|
61
58
|
});
|
|
62
59
|
}
|
|
@@ -53,7 +53,7 @@ let RestrictedFieldsPipe = class RestrictedFieldsPipe {
|
|
|
53
53
|
return value;
|
|
54
54
|
for (const [propertyKey, requiredPerms] of Object.entries(restrictions)) {
|
|
55
55
|
if (requiredPerms.length && !(0, itlab_functions_1.hasSomePermission)(requiredPerms, grantedPerms)) {
|
|
56
|
-
|
|
56
|
+
value[propertyKey] = undefined;
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
return value;
|