Skip to content

Commit

Permalink
update getChatHistory
Browse files Browse the repository at this point in the history
  • Loading branch information
kocherovv committed Feb 29, 2024
1 parent e26a6f9 commit 6f90e36
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/utils/MessageAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ class MessageAPI {
/**
* Returns history of chat
*/
async getChatHistory(chatId) {
async getChatHistory(chatId, count) {
CommonUtils.validateChatIdPhoneNumber(chatId, undefined);

const method = 'getChatHistory';
Expand All @@ -321,6 +321,10 @@ class MessageAPI {
'chatId': chatId,
}

if (count && count > 0) {
postData.count = count;
}

this.addChadIdParam(postData, chatId)

const response = await axios.post(CommonUtils.generateMethodURL(this._restAPI.params, method), postData);
Expand Down

0 comments on commit 6f90e36

Please sign in to comment.