Browse Source

issue-14/update-custom-params-key-to-work-as-object-not-array

Azat Gataullin 5 years ago
parent
commit
91d35923ca

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

@@ -26,7 +26,7 @@ const CustomParams: React.FC<Props> = ({
   const onAdd = (event: React.MouseEvent<HTMLButtonElement>) => {
   const onAdd = (event: React.MouseEvent<HTMLButtonElement>) => {
     event.preventDefault();
     event.preventDefault();
 
 
-    const newIndex = `${INDEX_PREFIX}.${new Date().getTime()}`;
+    const newIndex = `${INDEX_PREFIX}.${new Date().getTime()}ts`;
 
 
     setFormCustomParams({
     setFormCustomParams({
       ...formCustomParams,
       ...formCustomParams,

+ 2 - 0
kafka-ui-react-app/src/redux/api/topics.ts

@@ -33,6 +33,7 @@ export const postTopic = (clusterName: ClusterName, form: TopicFormData): Promis
     retentionMs,
     retentionMs,
     maxMessageBytes,
     maxMessageBytes,
     minInSyncReplicas,
     minInSyncReplicas,
+    customParams,
   } = form;
   } = form;
   const body = JSON.stringify({
   const body = JSON.stringify({
     name,
     name,
@@ -44,6 +45,7 @@ export const postTopic = (clusterName: ClusterName, form: TopicFormData): Promis
       'retention.bytes': retentionBytes,
       'retention.bytes': retentionBytes,
       'max.message.bytes': maxMessageBytes,
       'max.message.bytes': maxMessageBytes,
       'min.insync.replicas': minInSyncReplicas,
       'min.insync.replicas': minInSyncReplicas,
+      customParams,
     }
     }
   });
   });
   return fetch(`${BASE_URL}/clusters/${clusterName}/topics`, {
   return fetch(`${BASE_URL}/clusters/${clusterName}/topics`, {