Skip to content
Snippets Groups Projects
Commit 3f573196 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

refresh comment list after adding

parent 5175edb3
No related branches found
No related tags found
2 merge requests!223reset the pin numbers before search results are fetch (so the results will be...,!202Resolve "[MIN-264] Right click - Add comment"
...@@ -7,6 +7,7 @@ import { addComment } from '@/redux/comment/thunks/addComment'; ...@@ -7,6 +7,7 @@ import { addComment } from '@/redux/comment/thunks/addComment';
import { useAppSelector } from '@/redux/hooks/useAppSelector'; import { useAppSelector } from '@/redux/hooks/useAppSelector';
import { lastRightClickSelector } from '@/redux/models/models.selectors'; import { lastRightClickSelector } from '@/redux/models/models.selectors';
import { closeModal } from '@/redux/modal/modal.slice'; import { closeModal } from '@/redux/modal/modal.slice';
import { getComments } from '@/redux/comment/thunks/getComments';
export const AddCommentModal: React.FC = () => { export const AddCommentModal: React.FC = () => {
const dispatch = useAppDispatch(); const dispatch = useAppDispatch();
...@@ -28,6 +29,7 @@ export const AddCommentModal: React.FC = () => { ...@@ -28,6 +29,7 @@ export const AddCommentModal: React.FC = () => {
e.preventDefault(); e.preventDefault();
await dispatch(addComment(data)); await dispatch(addComment(data));
dispatch(closeModal()); dispatch(closeModal());
dispatch(getComments());
}; };
return ( return (
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment