Browse Source

Remove unused thunk

Azat Belgibayev 3 years ago
parent
commit
3117883862

+ 1 - 0
kafka-ui-react-app/src/components/Topics/New/New.tsx

@@ -54,6 +54,7 @@ const New: React.FC<Props> = () => {
         title: `Schema ${data.name}`,
         response,
       };
+
       dispatch(createTopicAction.failure({ alert }));
     }
   };

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

@@ -211,40 +211,6 @@ const formatTopicUpdate = (form: TopicFormDataRaw): TopicUpdate => {
   };
 };
 
-export const createTopic =
-  (clusterName: ClusterName, form: TopicFormDataRaw): PromiseThunkResult =>
-  async (dispatch, getState) => {
-    dispatch(actions.createTopicAction.request());
-    try {
-      const topic: Topic = await topicsApiClient.createTopic({
-        clusterName,
-        topicCreation: formatTopicCreation(form),
-      });
-
-      const state = getState().topics;
-      const newState = {
-        ...state,
-        byName: {
-          ...state.byName,
-          [topic.name]: {
-            ...topic,
-          },
-        },
-        allNames: [...state.allNames, topic.name],
-      };
-
-      dispatch(actions.createTopicAction.success(newState));
-    } catch (error) {
-      const response = await getResponse(error);
-      const alert: FailurePayload = {
-        subject: ['schema', form.name].join('-'),
-        title: `Schema ${form.name}`,
-        response,
-      };
-      dispatch(actions.createTopicAction.failure({ alert }));
-    }
-  };
-
 export const updateTopic =
   (
     clusterName: ClusterName,