fix maxId on api

This commit is contained in:
Mary Kate 2020-09-27 11:54:23 -05:00 committed by Angelina Filippova
parent c615902cee
commit 4cfab828e7
2 changed files with 4 additions and 5 deletions

View File

@ -20,10 +20,9 @@ export async function fetchChat(id, authHost, token) {
})
}
export async function fetchChatMessages(id, max_id, authHost, token) {
let url
const url = max_id
? `/api/pleroma/admin/chats/${id}/messages?max_id=${max_id}`
export async function fetchChatMessages(id, maxId, authHost, token) {
const url = maxId
? `/api/pleroma/admin/chats/${id}/messages?max_id=${maxId}`
: `/api/pleroma/admin/chats/${id}/messages`
return await request({
baseURL: baseName(authHost),

View File

@ -45,7 +45,7 @@ describe('Chat view', () => {
expect(wrapper.find('.chat-particiants-receiver').isVisible()).toBe(true)
expect(store.state.chat.fetchedChat.receiver.acct).toBe('test10')
expect(store.state.chat.fetchedChatMessages[0].chat_id).toBe('9y8e7ESoVUiKVMAoCW')
expect(store.state.chat.max_id).toBe(null)
expect(store.state.chat.maxId).toBe(null)
done()
})
})