Files
smoothschedule/frontend/src/hooks/usePlatformOAuth.ts
poduck 2e111364a2 Initial commit: SmoothSchedule multi-tenant scheduling platform
This commit includes:
- Django backend with multi-tenancy (django-tenants)
- React + TypeScript frontend with Vite
- Platform administration API with role-based access control
- Authentication system with token-based auth
- Quick login dev tools for testing different user roles
- CORS and CSRF configuration for local development
- Docker development environment setup

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-27 01:43:20 -05:00

37 lines
869 B
TypeScript

/**
* 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<PlatformOAuthSettings>({
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);
},
});
};