From 4cfab828e73de188f838c10bb5c4db04fb5267a5 Mon Sep 17 00:00:00 2001 From: Mary Kate Date: Sun, 27 Sep 2020 11:54:23 -0500 Subject: [PATCH] fix maxId on api --- src/api/chat.js | 7 +++---- test/views/chats/show.test.js | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/api/chat.js b/src/api/chat.js index 3e483ea4..73990cfa 100644 --- a/src/api/chat.js +++ b/src/api/chat.js @@ -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), diff --git a/test/views/chats/show.test.js b/test/views/chats/show.test.js index ac334393..5dd7e4ec 100644 --- a/test/views/chats/show.test.js +++ b/test/views/chats/show.test.js @@ -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() }) })