mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 10:27:26 +00:00
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:
@@ -38,7 +38,7 @@ export const useCreateWsTag = () => {
|
|||||||
mutationFn: async ({ workspaceID, tagName, tagColor, tagSlug }) => {
|
mutationFn: async ({ workspaceID, tagName, tagColor, tagSlug }) => {
|
||||||
const { data } = await apiRequest.post(`/api/v2/workspace/${workspaceID}/tags`, {
|
const { data } = await apiRequest.post(`/api/v2/workspace/${workspaceID}/tags`, {
|
||||||
name: tagName,
|
name: tagName,
|
||||||
tagColor: tagColor || null,
|
tagColor: tagColor || "",
|
||||||
slug: tagSlug
|
slug: tagSlug
|
||||||
})
|
})
|
||||||
return data;
|
return data;
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ export type CreateTagDTO = {
|
|||||||
workspaceID: string;
|
workspaceID: string;
|
||||||
tagSlug: string;
|
tagSlug: string;
|
||||||
tagName: string;
|
tagName: string;
|
||||||
tagColor: string | null;
|
tagColor: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type CreateTagRes = {
|
export type CreateTagRes = {
|
||||||
|
|||||||
+3
-2
@@ -53,8 +53,8 @@ export const AddSecretTagModal = ({
|
|||||||
await createWsTag.mutateAsync({
|
await createWsTag.mutateAsync({
|
||||||
workspaceID: currentWorkspace?._id,
|
workspaceID: currentWorkspace?._id,
|
||||||
tagName: name,
|
tagName: name,
|
||||||
tagSlug: name.replace(" ", "_"),
|
tagSlug: name.replace(/\s+/g, " ").replace(" ", "_"),
|
||||||
tagColor: null
|
tagColor: ""
|
||||||
});
|
});
|
||||||
|
|
||||||
handlePopUpClose("CreateSecretTag");
|
handlePopUpClose("CreateSecretTag");
|
||||||
@@ -63,6 +63,7 @@ export const AddSecretTagModal = ({
|
|||||||
text: "Successfully created a tag",
|
text: "Successfully created a tag",
|
||||||
type: "success"
|
type: "success"
|
||||||
});
|
});
|
||||||
|
reset()
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
createNotification({
|
createNotification({
|
||||||
|
|||||||
Reference in New Issue
Block a user