|
@@ -14,7 +14,9 @@ import { InputLabel } from 'components/common/Input/InputLabel.styled';
|
|
|
import PageHeading from 'components/common/PageHeading/PageHeading';
|
|
|
import { useAppDispatch, useAppSelector } from 'lib/hooks/redux';
|
|
|
import {
|
|
|
+ schemaAdded,
|
|
|
schemasApiClient,
|
|
|
+ schemaUpdated,
|
|
|
selectSchemaById,
|
|
|
} from 'redux/reducers/schemas/schemasSlice';
|
|
|
import { serverErrorAlertAdded } from 'redux/reducers/alerts/alertsSlice';
|
|
@@ -48,7 +50,7 @@ const Edit: React.FC = () => {
|
|
|
|
|
|
try {
|
|
|
if (dirtyFields.newSchema || dirtyFields.schemaType) {
|
|
|
- await schemasApiClient.createNewSchema({
|
|
|
+ const resp = await schemasApiClient.createNewSchema({
|
|
|
clusterName,
|
|
|
newSchemaSubject: {
|
|
|
...schema,
|
|
@@ -56,6 +58,7 @@ const Edit: React.FC = () => {
|
|
|
schemaType: props.schemaType || schema.schemaType,
|
|
|
},
|
|
|
});
|
|
|
+ dispatch(schemaAdded(resp));
|
|
|
}
|
|
|
|
|
|
if (dirtyFields.compatibilityLevel) {
|
|
@@ -66,6 +69,12 @@ const Edit: React.FC = () => {
|
|
|
compatibility: props.compatibilityLevel,
|
|
|
},
|
|
|
});
|
|
|
+ dispatch(
|
|
|
+ schemaUpdated({
|
|
|
+ ...schema,
|
|
|
+ compatibilityLevel: props.compatibilityLevel,
|
|
|
+ })
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
history.push(clusterSchemaPath(clusterName, subject));
|