@amityco/ts-sdk 7.8.2-18c9ea07.0 → 7.8.2-eb8a50a.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.
package/dist/index.cjs.js CHANGED
@@ -15220,19 +15220,12 @@ const prepareSemanticSearchPostPayload = (_a) => {
15220
15220
  const processDeleteChildPost = (payload) => {
15221
15221
  var _a;
15222
15222
  const post = payload.posts[0];
15223
- if (!post.parentId) {
15224
- // post is parent post => should mark child post as delete as well
15225
- post.children.forEach(childrenId => mergeInCache(['post', 'get', childrenId], {
15226
- isDeleted: true,
15227
- }));
15228
- }
15229
- else {
15230
- // child post in a parent post
15231
- const parentPost = (_a = pullFromCache(['post', 'get', post.parentPostId])) === null || _a === void 0 ? void 0 : _a.data;
15232
- if (!parentPost)
15233
- return;
15234
- pushToCache(['post', 'get', parentPost.postId], Object.assign(Object.assign({}, parentPost), { children: parentPost.children.filter(childId => childId !== post.postId) }));
15235
- }
15223
+ if (!post.parentId)
15224
+ return;
15225
+ const parentPost = (_a = pullFromCache(['post', 'get', post.parentPostId])) === null || _a === void 0 ? void 0 : _a.data;
15226
+ if (!parentPost)
15227
+ return;
15228
+ pushToCache(['post', 'get', parentPost.postId], Object.assign(Object.assign({}, parentPost), { children: parentPost.children.filter(childId => childId !== post.postId) }));
15236
15229
  };
15237
15230
  const processCreateChildPost = (payload) => {
15238
15231
  var _a;
package/dist/index.esm.js CHANGED
@@ -31311,19 +31311,12 @@ const prepareSemanticSearchPostPayload = (_a) => {
31311
31311
  const processDeleteChildPost = (payload) => {
31312
31312
  var _a;
31313
31313
  const post = payload.posts[0];
31314
- if (!post.parentId) {
31315
- // post is parent post => should mark child post as delete as well
31316
- post.children.forEach(childrenId => mergeInCache(['post', 'get', childrenId], {
31317
- isDeleted: true,
31318
- }));
31319
- }
31320
- else {
31321
- // child post in a parent post
31322
- const parentPost = (_a = pullFromCache(['post', 'get', post.parentPostId])) === null || _a === void 0 ? void 0 : _a.data;
31323
- if (!parentPost)
31324
- return;
31325
- pushToCache(['post', 'get', parentPost.postId], Object.assign(Object.assign({}, parentPost), { children: parentPost.children.filter(childId => childId !== post.postId) }));
31326
- }
31314
+ if (!post.parentId)
31315
+ return;
31316
+ const parentPost = (_a = pullFromCache(['post', 'get', post.parentPostId])) === null || _a === void 0 ? void 0 : _a.data;
31317
+ if (!parentPost)
31318
+ return;
31319
+ pushToCache(['post', 'get', parentPost.postId], Object.assign(Object.assign({}, parentPost), { children: parentPost.children.filter(childId => childId !== post.postId) }));
31327
31320
  };
31328
31321
  const processCreateChildPost = (payload) => {
31329
31322
  var _a;