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

This commit is contained in:
Ebezer Igbinoba
2023-08-24 03:39:46 +01:00
parent 8d3d7d98e3
commit ae375916e8
3 changed files with 4 additions and 3 deletions

View File

@@ -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;

View File

@@ -17,7 +17,7 @@ export type CreateTagDTO = {
workspaceID: string;
tagSlug: string;
tagName: string;
tagColor: string;
tagColor: string | null;
};
export type CreateTagRes = {

View File

@@ -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");