diff --git a/src/KBBoard/BoardLogic.js b/src/KBBoard/BoardLogic.js index d346ce9..6dd3933 100644 --- a/src/KBBoard/BoardLogic.js +++ b/src/KBBoard/BoardLogic.js @@ -132,7 +132,7 @@ export const useBoardLogic = (id, setError, setInfo, setCategories, setLoading, } finally { setLoading(false); } - }, [setLoading, setError]); + }, [setLoading, setError, navigate]); const deleteCategory = useCallback(async (categoryId, modalDelCateg, modalEditCateg) => { setLoading(true); @@ -203,6 +203,7 @@ export const useBoardLogic = (id, setError, setInfo, setCategories, setLoading, await quitMemberAPI( boardId ); await loadBoardData(); modalQuitMember(); + navigate('/kanban-boards-list'); } catch { setError('Ошибка'); } finally{ @@ -222,7 +223,7 @@ export const useBoardLogic = (id, setError, setInfo, setCategories, setLoading, } finally { setLoading(false); } - }, [loadBoardData, setLoading, setError, navigate]); + }, [loadBoardData, setLoading, setError]); diff --git a/src/KBBoard/KBBoard.js b/src/KBBoard/KBBoard.js index 415423c..fc92c1c 100644 --- a/src/KBBoard/KBBoard.js +++ b/src/KBBoard/KBBoard.js @@ -43,7 +43,6 @@ const KBBoard = () => { const [assignedMember, setAssignedMember] = useState(0); const [addedUsername, setAddedUsername] = useState(''); const [deletedMember, setDeletedMember] = useState(''); - const { loadBoardData, createTask, @@ -67,7 +66,7 @@ const KBBoard = () => { return ( @@ -150,8 +149,7 @@ const KBBoard = () => { const handleEditBoard = async (e) => { e.preventDefault(); await editBoard(id, boardTitle, boardDescription, modalEditBoard); - }; - + }; const handleEditCategory = async (e) => { e.preventDefault(); await editCategory(editedCateg.id, categoryTitle, modalEditCateg); @@ -205,7 +203,7 @@ const KBBoard = () => { Участники: {(info.members || []).map((member) => ( (member.id !== info.owner.id) ? ( - + ) : ( <> ) @@ -270,10 +268,9 @@ const KBBoard = () => { @@ -520,19 +517,19 @@ const KBBoard = () => { {addMemb && (
-

Добавление участникf

+

Добавление участника

- + setAddedUsername(e.target.value)} /> - +
@@ -602,7 +599,7 @@ const KBBoard = () => { @@ -640,9 +637,6 @@ const KBBoard = () => { )} - - - );