mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-23 08:58:26 +00:00
Merge pull request #12575 from ToolJet/fix/version-create-del-error-message
fix: update version creatin and deletion error messages
This commit is contained in:
commit
83b46e0922
2 changed files with 7 additions and 8 deletions
|
|
@ -15,7 +15,7 @@ const CreateVersionModal = ({
|
|||
canCommit,
|
||||
orgGit,
|
||||
fetchingOrgGit,
|
||||
handleCommitOnVersionCreation = () => {},
|
||||
handleCommitOnVersionCreation = () => { },
|
||||
}) => {
|
||||
const [isCreatingVersion, setIsCreatingVersion] = useState(false);
|
||||
const [versionName, setVersionName] = useState('');
|
||||
|
|
@ -94,12 +94,15 @@ const CreateVersionModal = ({
|
|||
handleCommitOnVersionCreation(data);
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log({ error });
|
||||
toast.error(error);
|
||||
});
|
||||
},
|
||||
(error) => {
|
||||
toast.error(error?.error);
|
||||
if (error?.data?.code === "23505") {
|
||||
toast.error("Version name already exists.");
|
||||
} else {
|
||||
toast.error(error?.error);
|
||||
}
|
||||
setIsCreatingVersion(false);
|
||||
}
|
||||
);
|
||||
|
|
|
|||
|
|
@ -150,11 +150,7 @@ export const CustomSelect = ({ currentEnvironment, onSelectVersion, ...props })
|
|||
{/* When we merge this code to EE update the defaultAppEnvironments object with rest of default environments (then delete this comment)*/}
|
||||
<ConfirmDialog
|
||||
show={deleteVersion.showModal}
|
||||
message={`${
|
||||
defaultAppEnvironments.length > 1
|
||||
? 'Deleting a version will permanently remove it from all environments.'
|
||||
: ''
|
||||
}Are you sure you want to delete this version - ${decodeEntities(deleteVersion.versionName)}?`}
|
||||
message={`Are you sure you want to delete this version - ${decodeEntities(deleteVersion.versionName)}?`}
|
||||
onConfirm={() => deleteAppVersion(deleteVersion.versionId, deleteVersion.versionName)}
|
||||
onCancel={resetDeleteModal}
|
||||
/>
|
||||
|
|
|
|||
Loading…
Reference in a new issue