소스 검색

Fix incorrect order of requests for changing SR compatibility lvl (#2201)

Robert Azizbekyan 3 년 전
부모
커밋
5cb1a7e0ce
1개의 변경된 파일11개의 추가작업 그리고 12개의 파일을 삭제
  1. 11 12
      kafka-ui-react-app/src/components/Schemas/Edit/Edit.tsx

+ 11 - 12
kafka-ui-react-app/src/components/Schemas/Edit/Edit.tsx

@@ -62,18 +62,6 @@ const Edit: React.FC = () => {
     if (!schema) return;
 
     try {
-      if (dirtyFields.newSchema || dirtyFields.schemaType) {
-        const resp = await schemasApiClient.createNewSchema({
-          clusterName,
-          newSchemaSubject: {
-            ...schema,
-            schema: props.newSchema || schema.schema,
-            schemaType: props.schemaType || schema.schemaType,
-          },
-        });
-        dispatch(schemaAdded(resp));
-      }
-
       if (dirtyFields.compatibilityLevel) {
         await schemasApiClient.updateSchemaCompatibilityLevel({
           clusterName,
@@ -89,6 +77,17 @@ const Edit: React.FC = () => {
           })
         );
       }
+      if (dirtyFields.newSchema || dirtyFields.schemaType) {
+        const resp = await schemasApiClient.createNewSchema({
+          clusterName,
+          newSchemaSubject: {
+            ...schema,
+            schema: props.newSchema || schema.schema,
+            schemaType: props.schemaType || schema.schemaType,
+          },
+        });
+        dispatch(schemaAdded(resp));
+      }
 
       navigate(clusterSchemaPath(clusterName, subject));
     } catch (e) {