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) { export async function fetchChatMessages(id, maxId, authHost, token) {
let url const url = maxId
const url = max_id ? `/api/pleroma/admin/chats/${id}/messages?max_id=${maxId}`
? `/api/pleroma/admin/chats/${id}/messages?max_id=${max_id}`
: `/api/pleroma/admin/chats/${id}/messages` : `/api/pleroma/admin/chats/${id}/messages`
return await request({ return await request({
baseURL: baseName(authHost), baseURL: baseName(authHost),

View file

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