Fix: added empty string as default for tag color and added regex to resolve issue with multiple spacing in tag names.

This commit is contained in:
Ebezer Igbinoba
2023-08-24 03:59:49 +01:00
parent ae375916e8
commit 9fa28f5b5e
3 changed files with 5 additions and 4 deletions
@@ -53,8 +53,8 @@ export const AddSecretTagModal = ({
await createWsTag.mutateAsync({
workspaceID: currentWorkspace?._id,
tagName: name,
tagSlug: name.replace(" ", "_"),
tagColor: null
tagSlug: name.replace(/\s+/g, " ").replace(" ", "_"),
tagColor: ""
});
handlePopUpClose("CreateSecretTag");
@@ -63,6 +63,7 @@ export const AddSecretTagModal = ({
text: "Successfully created a tag",
type: "success"
});
reset()
} catch (err) {
console.error(err);
createNotification({