Selaa lähdekoodia

api requests for issues/243 and issues/244

Ilnur Yakupov 3 vuotta sitten
vanhempi
commit
bd7ae932e8

+ 4 - 0
kafka-ui-react-app/src/components/Topics/List/ListContainer.ts

@@ -3,6 +3,8 @@ import { RootState } from 'redux/interfaces';
 import {
   fetchTopicsList,
   deleteTopic,
+  deleteTopics,
+  clearTopicsMessages,
   clearTopicMessages,
   setTopicsSearchAction,
   setTopicsOrderByAction,
@@ -28,6 +30,8 @@ const mapStateToProps = (state: RootState) => ({
 const mapDispatchToProps = {
   fetchTopicsList,
   deleteTopic,
+  deleteTopics,
+  clearTopicsMessages,
   clearTopicMessages,
   setTopicsSearch: setTopicsSearchAction,
   setTopicsOrderBy: setTopicsOrderByAction,

+ 16 - 0
kafka-ui-react-app/src/redux/actions/thunks/topics.ts

@@ -87,6 +87,14 @@ export const clearTopicMessages =
     }
   };
 
+export const clearTopicsMessages =
+  (clusterName: ClusterName, topicsName: TopicName[]): PromiseThunkResult =>
+  async (dispatch) => {
+    topicsName.forEach((topicName) => {
+      dispatch(clearTopicMessages(clusterName, topicName));
+    });
+  };
+
 export const fetchTopicDetails =
   (clusterName: ClusterName, topicName: TopicName): PromiseThunkResult =>
   async (dispatch, getState) => {
@@ -285,6 +293,14 @@ export const deleteTopic =
     }
   };
 
+export const deleteTopics =
+  (clusterName: ClusterName, topicsName: TopicName[]): PromiseThunkResult =>
+  async (dispatch) => {
+    topicsName.forEach((topicName) => {
+      dispatch(deleteTopic(clusterName, topicName));
+    });
+  };
+
 export const fetchTopicConsumerGroups =
   (clusterName: ClusterName, topicName: TopicName): PromiseThunkResult =>
   async (dispatch, getState) => {