Add pagination to message screen.
This commit is contained in:
parent
0b9ed3a68a
commit
cedbd2b3c0
5 changed files with 94 additions and 9 deletions
|
|
@ -69,7 +69,7 @@ async function downloadFile(path, options = {}) {
|
|||
|
||||
export const waha = {
|
||||
async getVersion() {
|
||||
return request('/api/version');
|
||||
return await request('/api/version');
|
||||
},
|
||||
|
||||
async getChats() {
|
||||
|
|
@ -89,8 +89,9 @@ export const waha = {
|
|||
});
|
||||
},
|
||||
|
||||
async getChatMessages(chatId) {
|
||||
return request(`/api/${config.session}/chats/${chatId}/messages?downloadMedia=false&limit=40`);
|
||||
async getChatMessages(chatId, beforeTimestamp) {
|
||||
console.log(`/api/${config.session}/chats/${chatId}/messages?downloadMedia=false&limit=40&sortBy=timestamp${beforeTimestamp ? `&filter.timestamp.gte=${beforeTimestamp}` : "" }`);
|
||||
return request(`/api/${config.session}/chats/${chatId}/messages?downloadMedia=false&limit=40${beforeTimestamp ? `&filter.timestamp.lte=${beforeTimestamp}` : "" }`);
|
||||
},
|
||||
|
||||
async getSingleChatMessage(chatId, messageId, downladMedia) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue