Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

Fix: added nullable check for adding tag color in project settings

Ebezer Igbinobaae375916e8d3
diff --git a/frontend/src/hooks/api/tags/queries.tsx b/frontend/src/hooks/api/tags/queries.tsx
index 0b7fb7c17f..517eb93540 100644
--- a/frontend/src/hooks/api/tags/queries.tsx
+++ b/frontend/src/hooks/api/tags/queries.tsx
@@ -38,7 +38,7 @@ export const useCreateWsTag = () => {
mutationFn: async ({ workspaceID, tagName, tagColor, tagSlug }) => {
const { data } = await apiRequest.post(`/api/v2/workspace/${workspaceID}/tags`, {
name: tagName,
- tagColor,
+ tagColor: tagColor || null,
slug: tagSlug
})
return data;
diff --git a/frontend/src/hooks/api/tags/types.ts b/frontend/src/hooks/api/tags/types.ts
index de09f5ac47..9d3129886f 100644
--- a/frontend/src/hooks/api/tags/types.ts
+++ b/frontend/src/hooks/api/tags/types.ts
@@ -17,7 +17,7 @@ export type CreateTagDTO = {
workspaceID: string;
tagSlug: string;
tagName: string;
- tagColor: string;
+ tagColor: string | null;
};
export type CreateTagRes = {
diff --git a/frontend/src/views/Settings/ProjectSettingsPage/components/SecretTagsSection/AddSecretTagModal.tsx b/frontend/src/views/Settings/ProjectSettingsPage/components/SecretTagsSection/AddSecretTagModal.tsx
index a3b004c6a5..2a349229ef 100644
--- a/frontend/src/views/Settings/ProjectSettingsPage/components/SecretTagsSection/AddSecretTagModal.tsx
+++ b/frontend/src/views/Settings/ProjectSettingsPage/components/SecretTagsSection/AddSecretTagModal.tsx
@@ -53,7 +53,8 @@ export const AddSecretTagModal = ({
await createWsTag.mutateAsync({
workspaceID: currentWorkspace?._id,
tagName: name,
- tagSlug: name.replace(" ", "_")
+ tagSlug: name.replace(" ", "_"),
+ tagColor: null
});
handlePopUpClose("CreateSecretTag");