api requests for issues/243 and issues/244

This commit is contained in:
Ilnur Yakupov 2021-08-05 13:03:27 +03:00
parent 08a3c5e225
commit bd7ae932e8
2 changed files with 20 additions and 0 deletions

View file

@ -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,

View file

@ -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) => {