Skip to content

Commit

Permalink
Validate every updated manifest when user changes something (folder, …
Browse files Browse the repository at this point in the history
…file name or content) (#2561) (#2562)
  • Loading branch information
ammont82 authored Apr 19, 2024
1 parent 51c1f7e commit eac2f42
Showing 1 changed file with 1 addition and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,6 @@ const AutosaveWithParentUpdate = ({
return null;
};

const manifestUpdated = (manifest: CustomManifestValues, oldManifest: CustomManifestValues) => {
return (
oldManifest.filename !== manifest.filename ||
oldManifest.folder !== manifest.folder ||
oldManifest.manifestYaml !== manifest.manifestYaml
);
};

export const CustomManifestsForm = ({
onFormStateChange,
getEmptyValues,
Expand Down Expand Up @@ -105,10 +97,7 @@ export const CustomManifestsForm = ({
} else {
// manifest updated
const oldManifest = customManifestsLocalRef.current[index];

if (manifestUpdated(manifest, oldManifest)) {
await ClustersService.updateCustomManifest(oldManifest, manifest, cluster.id);
}
await ClustersService.updateCustomManifest(oldManifest, manifest, cluster.id);
}
} catch (error) {
const errorArray = new Array(manifests.length).fill(undefined);
Expand Down

0 comments on commit eac2f42

Please sign in to comment.