@amityco/ts-sdk 7.8.6-3e13cfa.0 → 7.8.6-4b6075d.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
@@ -16135,15 +16135,15 @@ const REFERENCE_API_V5 = 5;
16135
16135
 
16136
16136
  class ReactionPaginationController extends PaginationController {
16137
16137
  async getRequest(queryParams, token) {
16138
- const { limit = COLLECTION_DEFAULT_PAGINATION_LIMIT, referenceType } = queryParams, params = __rest(queryParams, ["limit", "referenceType"]);
16138
+ const { limit = COLLECTION_DEFAULT_PAGINATION_LIMIT } = queryParams, params = __rest(queryParams, ["limit"]);
16139
16139
  const options = token ? { token } : { limit };
16140
16140
  const client = getActiveClient();
16141
16141
  client.log('reaction/queryReactions', queryParams);
16142
16142
  const path = '/api/v3/reactions';
16143
- if (!['post', 'comment', 'story', 'message'].includes(referenceType))
16143
+ if (!['post', 'comment', 'story', 'message'].includes(params.referenceType))
16144
16144
  throw new ASCApiError('The reference type is not valid. It should be one of post, comment, story, or message', 400000 /* Amity.ServerError.BAD_REQUEST */, "error" /* Amity.ErrorLevel.ERROR */);
16145
16145
  const { data: queryResponse } = await this.http.get(path, {
16146
- params: Object.assign(Object.assign({}, params), { referenceType, referenceVersion: referenceType === 'message' ? REFERENCE_API_V5 : undefined, // Need to put this param to make it can query reaction for message in sub-channel
16146
+ params: Object.assign(Object.assign({}, params), { referenceVersion: REFERENCE_API_V5, // Need to put this param to make it can query reaction for message in sub-channel
16147
16147
  options }),
16148
16148
  });
16149
16149
  return queryResponse;
package/dist/index.esm.js CHANGED
@@ -32227,15 +32227,15 @@ const REFERENCE_API_V5 = 5;
32227
32227
 
32228
32228
  class ReactionPaginationController extends PaginationController {
32229
32229
  async getRequest(queryParams, token) {
32230
- const { limit = COLLECTION_DEFAULT_PAGINATION_LIMIT, referenceType } = queryParams, params = __rest(queryParams, ["limit", "referenceType"]);
32230
+ const { limit = COLLECTION_DEFAULT_PAGINATION_LIMIT } = queryParams, params = __rest(queryParams, ["limit"]);
32231
32231
  const options = token ? { token } : { limit };
32232
32232
  const client = getActiveClient();
32233
32233
  client.log('reaction/queryReactions', queryParams);
32234
32234
  const path = '/api/v3/reactions';
32235
- if (!['post', 'comment', 'story', 'message'].includes(referenceType))
32235
+ if (!['post', 'comment', 'story', 'message'].includes(params.referenceType))
32236
32236
  throw new ASCApiError('The reference type is not valid. It should be one of post, comment, story, or message', 400000 /* Amity.ServerError.BAD_REQUEST */, "error" /* Amity.ErrorLevel.ERROR */);
32237
32237
  const { data: queryResponse } = await this.http.get(path, {
32238
- params: Object.assign(Object.assign({}, params), { referenceType, referenceVersion: referenceType === 'message' ? REFERENCE_API_V5 : undefined, // Need to put this param to make it can query reaction for message in sub-channel
32238
+ params: Object.assign(Object.assign({}, params), { referenceVersion: REFERENCE_API_V5, // Need to put this param to make it can query reaction for message in sub-channel
32239
32239
  options }),
32240
32240
  });
32241
32241
  return queryResponse;