@@ -109,16 +109,15 @@ import VModal from "@/components/VModal.vue";
109109import { useFetchComments } from " @/composables/comments.composable" ;
110110import { useApplyFilters } from " @/composables/filter.composable" ;
111111import useFetchPost from " @/composables/posts.composable" ;
112- import { useToast } from " @/composables/toast .composable" ;
112+ import { useCustomToast } from " @/composables/customToast .composable" ;
113113import ThemeColor from " @/enums/ThemeColor" ;
114114import StorageService from " @/services/storage.service" ;
115115import { computed , reactive , ref , watch } from " vue" ;
116116
117117export default {
118118 name: " CommentsView" ,
119119 setup () {
120- const { showToast } = useToast ();
121-
120+ const { showToast } = useCustomToast ();
122121 const { comments , commentsIsLoading , fetchComments , changeStatus: changeCommentStatus } = useFetchComments ();
123122 fetchComments ({});
124123
@@ -194,22 +193,27 @@ export default {
194193 const regex = new RegExp (` (${ query} )` , " gi" );
195194 return String (text).replace (regex, " <mark>$1</mark>" );
196195 };
196+ const handleUndoRejection = () => {
197+ console .log (" Undo rejection callback executed" );
198+ };
199+
197200 const handleConfirmRejection = () => {
198- changeCommentStatus (rejectComment .comment .id , " REJECTED" );
199- showToast ({ body: " Undo" , theme: ThemeColor .WARNING , duration: 3000 });
200- rejectComment .comment = null ;
201+ showToast ({
202+ theme: ThemeColor .WARNING ,
203+ duration: 3000 ,
204+ callback: handleUndoRejection,
205+ });
201206 rejectComment .modalIsOpen = false ;
207+ rejectComment .comment = null ;
202208 };
203209
204210 const selectedRows = ref ([]);
205-
206211 const handleStatusChangeAll = (status ) => {
207212 selectedRows .value .forEach ((commentId ) => {
208213 changeCommentStatus (commentId, status);
209214 selectedRows .value = [];
210215 });
211216 };
212-
213217 return {
214218 comments: filteredComments,
215219 commentsIsLoading,
0 commit comments