@plusscommunities/pluss-core-aws 2.2.1-beta.0 → 2.2.3-beta.0

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.
@@ -1,7 +1,7 @@
1
1
  const indexQuery = require("../common/indexQuery");
2
2
  const deleteRef = require("../common/deleteRef");
3
3
 
4
- module.exports = async (entityId, type, site) => {
4
+ module.exports = async (entityId, type = null, site = null) => {
5
5
  const query = {
6
6
  IndexName: "NotificationsIdIndex",
7
7
  KeyConditionExpression: "Id = :entityId",
@@ -12,9 +12,8 @@ module.exports = async (entityId, type, site) => {
12
12
 
13
13
  let toDelete = [];
14
14
  const { Items } = await indexQuery("notifications", query);
15
- console.log("deleteNotificationsByEntity", JSON.stringify(Items, null, 2));
16
15
  if (type || site) {
17
- toDelete = Items.find(
16
+ toDelete = Items.filter(
18
17
  (i) => (!type || i.Type === type) && (!site || i.Site === site)
19
18
  );
20
19
  } else {
@@ -24,7 +23,6 @@ module.exports = async (entityId, type, site) => {
24
23
  const promises = [];
25
24
  toDelete.forEach((i) => {
26
25
  promises.push(deleteRef("notifications", "RowId", i.RowId));
27
- console.log("deleteNotificationsByEntity - deleted", i.RowId);
28
26
  });
29
27
 
30
28
  return Promise.all(promises);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plusscommunities/pluss-core-aws",
3
- "version": "2.2.1-beta.0",
3
+ "version": "2.2.3-beta.0",
4
4
  "description": "Core extension package for Pluss Communities platform",
5
5
  "scripts": {
6
6
  "betapatch": "npm version prepatch --preid=beta",