Add getting chat history logic

This commit is contained in:
Hepatica
2024-01-27 03:17:59 +01:00
parent 6d29ac44b9
commit 0151af15bd
2 changed files with 66 additions and 30 deletions

View File

@@ -49,6 +49,26 @@ export async function GetCurrentMoney(authToken, searchToken) {
}
}
export async function GetChatHistory() {
try {
const response = await fetch(`${BackendApiUrl}/ChatHistory/GetChatHistory`, {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: "",
redirect: "follow"
});
if (!response.ok) {
console.log("Fetch error:", response.status);
}
return await response.json();
} catch (error) {
console.log("Fetch error:", error);
}
}