[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:
parent
d759912c05
commit
aedf3c6536
2 changed files with 8 additions and 3 deletions
|
@ -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.
|
||||
};
|
||||
|
||||
|
|
|
@ -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),
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue