mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-15 18:15:53 +00:00
Merge pull request #889 from EBEN4REAL/custom-tag-colors
Custom tag colors
This commit is contained in:
@@ -7,7 +7,7 @@ import {
|
||||
CreateTagRes,
|
||||
DeleteTagDTO,
|
||||
DeleteWsTagRes,
|
||||
UserWsTags
|
||||
UserWsTags,
|
||||
} from "./types";
|
||||
|
||||
const workspaceTags = {
|
||||
@@ -30,13 +30,15 @@ export const useGetWsTags = (workspaceID: string) => {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
export const useCreateWsTag = () => {
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
return useMutation<CreateTagRes, {}, CreateTagDTO>({
|
||||
mutationFn: async ({ workspaceID, tagName, tagSlug }) => {
|
||||
mutationFn: async ({ workspaceID, tagName, tagColor, tagSlug }) => {
|
||||
const { data } = await apiRequest.post(`/api/v2/workspace/${workspaceID}/tags`, {
|
||||
name: tagName,
|
||||
tagColor: tagColor || "",
|
||||
slug: tagSlug
|
||||
})
|
||||
return data;
|
||||
@@ -47,6 +49,7 @@ export const useCreateWsTag = () => {
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
export const useDeleteWsTag = () => {
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ export type WsTag = {
|
||||
_id: string;
|
||||
name: string;
|
||||
slug: string;
|
||||
tagColor?: string;
|
||||
workspace: string;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
@@ -16,6 +17,7 @@ export type CreateTagDTO = {
|
||||
workspaceID: string;
|
||||
tagSlug: string;
|
||||
tagName: string;
|
||||
tagColor: string;
|
||||
};
|
||||
|
||||
export type CreateTagRes = {
|
||||
@@ -23,6 +25,7 @@ export type CreateTagRes = {
|
||||
slug: string;
|
||||
workspace: string;
|
||||
createdAt: string;
|
||||
tagColor?: string;
|
||||
user: string;
|
||||
_id: string;
|
||||
};
|
||||
@@ -36,4 +39,19 @@ export type DeleteWsTagRes = {
|
||||
createdAt: string;
|
||||
user: string;
|
||||
_id: string;
|
||||
};
|
||||
};
|
||||
|
||||
export type SecretTags = {
|
||||
id: string;
|
||||
_id: string;
|
||||
slug: string;
|
||||
tagColor: string;
|
||||
}
|
||||
|
||||
export type TagColor = {
|
||||
id: number;
|
||||
hex: string
|
||||
rgba: string
|
||||
name: string
|
||||
selected: boolean
|
||||
}
|
||||
Reference in New Issue
Block a user