diff --git a/src/pages/Journal.tsx b/src/pages/Journal.tsx index cb66956..0f39661 100644 --- a/src/pages/Journal.tsx +++ b/src/pages/Journal.tsx @@ -48,6 +48,24 @@ export const Journal = () => { check(); }, []); + const [answer, setAnswer] = useState(null); + + const send = async () => { + if (keycloak.authenticated) { + keycloak; + const rq = await fetch(`${getConfigValue("journal.back.url")}/test`, { + headers: { + accept: "application/json", + authorization: `Bearer ${keycloak.token}`, + }, + }); + const data = await rq.json(); + setAnswer(data); + } else { + setAnswer({ message: 'Пользователь не авторизован' }) + } + } + const [value, setValue] = useState(""); const handleChange = useCallback( (event) => { @@ -70,6 +88,10 @@ export const Journal = () => { return ( + + + +
{JSON.stringify(answer, null, 4)}
Название новой лекции: diff --git a/src/pages/main.tsx b/src/pages/main.tsx index 97d9ea5..bf973ac 100644 --- a/src/pages/main.tsx +++ b/src/pages/main.tsx @@ -64,12 +64,10 @@ const Input = ({ onStart }) => { } export const MainPage = () => { - const [shoList, setShoList] = useState(false); - return ( - {!shoList && setShoList(true)} />} - {shoList && } + {/* {!shoList && setShoList(true)} />} */} + ); };