refactor: изменена структура передаваемой информации между файлами "Logic" и "API"

This commit is contained in:
Vladiysss
2026-03-07 16:58:33 +03:00
parent 574562361a
commit ac1b6212e6
3 changed files with 127 additions and 160 deletions

View File

@@ -10,6 +10,7 @@ const KBBoard = () => {
const [loading, setLoading] = useState(false);
const [info, setInfo] = useState({});
const [categories, setCategories] = useState([]);
const [isOwner, setIsOwner] = useState(null);
const [crTask, setCrTask] = useState(false);
const [crCateg, setCrCateg] = useState(false);
@@ -56,6 +57,10 @@ const KBBoard = () => {
if (id) loadBoardData();
}, [id, loadBoardData]);
useEffect(() => {
if (info?.owner?.id !== undefined) checkOwner(info?.owner?.id, setIsOwner);
}, [info?.owner?.id, checkOwner, setIsOwner]);
const modalCrTask = (categori) => () => {
setCrTask(!crTask);
setTaskCategori(categori);
@@ -149,6 +154,7 @@ const KBBoard = () => {
};
return (
<div className="app-container">
<Header />
@@ -172,7 +178,11 @@ const KBBoard = () => {
</div>
</div>
<div className="set-panel" >
{checkOwner(info?.owner?.id) ? (
{loading ? (
<>
</>
) : isOwner ? (
<>
<button onClick={modalAddMember}>
Добавить участника