/** * Platform OAuth Settings Hooks */ import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'; import { getPlatformOAuthSettings, updatePlatformOAuthSettings, PlatformOAuthSettings, PlatformOAuthSettingsUpdate, } from '../api/platformOAuth'; /** * Hook to get platform OAuth settings */ export const usePlatformOAuthSettings = () => { return useQuery({ queryKey: ['platformOAuthSettings'], queryFn: getPlatformOAuthSettings, staleTime: 5 * 60 * 1000, // 5 minutes }); }; /** * Hook to update platform OAuth settings */ export const useUpdatePlatformOAuthSettings = () => { const queryClient = useQueryClient(); return useMutation({ mutationFn: updatePlatformOAuthSettings, onSuccess: (data) => { queryClient.setQueryData(['platformOAuthSettings'], data); }, }); };