feat: add tags

This commit is contained in:
2024-11-18 01:28:31 +07:00
parent 95f9f76edd
commit b0932c39b1
17 changed files with 409 additions and 67 deletions
+14
View File
@@ -66,3 +66,17 @@ export const useMoveHost = () => {
},
});
};
export const useTags = () => {
const teamId = useTeamId();
return useQuery({
queryKey: ["hosts/tags", teamId],
queryFn: () => api("/hosts/tags", { params: { teamId } }),
select: (data) => {
return data?.rows?.map((row: any) => ({
label: row.name,
value: row.name,
}));
},
});
};