[issues-252][bug] - Topic settings form is broken (#332)

add topicName in updateTopic function

Co-authored-by: mbovtryuk <mbovtryuk@provectus.com>
This commit is contained in:
TEDMykhailo 2021-03-31 12:01:43 +03:00 committed by GitHub
parent d759912c05
commit aedf3c6536
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View file

@ -21,7 +21,11 @@ interface Props {
isFetched: boolean;
isTopicUpdated: boolean;
fetchTopicConfig: (clusterName: ClusterName, topicName: TopicName) => void;
updateTopic: (clusterName: ClusterName, form: TopicFormDataRaw) => void;
updateTopic: (
clusterName: ClusterName,
topicName: TopicName,
form: TopicFormDataRaw
) => void;
}
const DEFAULTS = {
@ -104,7 +108,7 @@ const Edit: React.FC<Props> = ({
});
const onSubmit = async (data: TopicFormDataRaw) => {
updateTopic(clusterName, data);
updateTopic(clusterName, topicName, data);
setIsSubmitting(true); // Keep this action after updateTopic to prevent redirect before update.
};

View file

@ -234,13 +234,14 @@ export const createTopic = (
export const updateTopic = (
clusterName: ClusterName,
topicName: TopicName,
form: TopicFormDataRaw
): PromiseThunkResult => async (dispatch, getState) => {
dispatch(actions.updateTopicAction.request());
try {
const topic: Topic = await topicsApiClient.updateTopic({
clusterName,
topicName: form.name,
topicName,
topicUpdate: formatTopicUpdate(form),
});