retrieving chats

This commit is contained in:
Nikolai Petukhov
2024-10-04 11:21:21 +03:00
parent 073c61977f
commit d1e824ab77
11 changed files with 338 additions and 88 deletions

View File

@@ -2,10 +2,10 @@ import {getConfigValue} from "@brojs/cli";
const LOCAL = "http://localhost:8099";
const DEV = "https://dev.bro-js.ru/enterfront";
const DEV = "https://dev.bro-js.ru";
const SERVER = "";
export const BASE_API_URL = LOCAL + getConfigValue("enterfront.api");
export const BASE_API_URL = LOCAL + getConfigValue("enterfront.api") + "/enterfront";
// fetch(`${BASE_API_URL}/books/list`)
@@ -22,12 +22,7 @@ export async function post(path, body) {
});
console.log("Initial data from API:", res)
const txt = await res.text();
console.log("Initial text from API:", txt)
const data = JSON.parse(txt);
const data = JSON.parse(await res.text());
console.log("Data from API:", data)
if (res.status === 200) {
@@ -51,6 +46,7 @@ export async function get(path){
}
});
console.log("Data from API:", res)
const data = await res.json();
if (res.status === 200) {