feat: update

This commit is contained in:
2024-11-09 14:37:09 +00:00
parent 3ef0c93c8f
commit b50abccae0
26 changed files with 728 additions and 254 deletions
+17
View File
@@ -1,6 +1,7 @@
import { useMutation, useQuery } from "@tanstack/react-query";
import { FormSchema } from "../schema/form";
import api, { queryClient } from "@/lib/api";
import { useMemo } from "react";
export const useKeychains = () => {
return useQuery({
@@ -10,6 +11,22 @@ export const useKeychains = () => {
});
};
export const useKeychainsOptions = () => {
const keys = useKeychains();
const data = useMemo(() => {
const items: any[] = keys.data || [];
return items.map((key: any) => ({
type: key.type,
label: key.label,
value: key.id,
}));
}, [keys.data]);
return data;
};
export const useSaveHost = () => {
return useMutation({
mutationFn: async (body: FormSchema) => {