When loading VirtualLottery we fetch default size of messages from /api/chat/history and append to local chatHistory.

This commit is contained in:
2020-03-17 10:02:06 +01:00
parent cda945ead8
commit 278d252e1e
2 changed files with 20 additions and 2 deletions

View File

@@ -222,6 +222,19 @@ const register = (username, password) => {
})
}
const getChatHistory = (skip=null, take=null) => {
const url = new URL("/api/chat/history", BASE_URL);
if (!isNaN(skip))
url.searchParams.append("skip", skip);
if (!isNaN(take))
url.searchParams.append("take", take);
return fetch(url.href)
.then(resp => resp.json())
}
export {
statistics,
colorStatistics,
@@ -243,5 +256,6 @@ export {
winners,
winnersSecure,
deleteWinners,
deleteAttendees
deleteAttendees,
getChatHistory
};