retrieving chats
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user