From 5cb1a7e0ce53b673a0e5b5133b18818f13088568 Mon Sep 17 00:00:00 2001 From: Robert Azizbekyan <103438454+rAzizbekyan@users.noreply.github.com> Date: Sat, 25 Jun 2022 01:47:05 +0400 Subject: [PATCH] Fix incorrect order of requests for changing SR compatibility lvl (#2201) --- .../src/components/Schemas/Edit/Edit.tsx | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/kafka-ui-react-app/src/components/Schemas/Edit/Edit.tsx b/kafka-ui-react-app/src/components/Schemas/Edit/Edit.tsx index 550496d745..1b960675ec 100644 --- a/kafka-ui-react-app/src/components/Schemas/Edit/Edit.tsx +++ b/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) {