Remove admin functionality related code
The admin functionality related code has been removed which includes various user and organization functionalities like delete, update, ban etc. This includes action logic, UI components and supportive utility functions. Notable deletions include the server action files, dialog components for actions like banning and deleting, and related utility functions. This massive cleanup is aimed at simplifying the codebase and the commit reflects adherence to project restructuring.
This commit is contained in:
@@ -1,16 +1,19 @@
|
||||
import { useCallback } from 'react';
|
||||
|
||||
import { useQuery, useQueryClient } from '@tanstack/react-query';
|
||||
import type { Session } from '@supabase/supabase-js';
|
||||
|
||||
import { useQueryClient, useSuspenseQuery } from '@tanstack/react-query';
|
||||
|
||||
import { useSupabase } from './use-supabase';
|
||||
|
||||
const queryKey = ['supabase:session'];
|
||||
|
||||
export function useUserSession() {
|
||||
export function useUserSession(initialSession?: Session | null) {
|
||||
const supabase = useSupabase();
|
||||
|
||||
const queryFn = async () => {
|
||||
const { data, error } = await supabase.auth.getSession();
|
||||
console.log(data, error);
|
||||
|
||||
if (error) {
|
||||
throw error;
|
||||
}
|
||||
@@ -18,7 +21,11 @@ export function useUserSession() {
|
||||
return data.session;
|
||||
};
|
||||
|
||||
return useQuery({ queryKey, queryFn });
|
||||
return useSuspenseQuery({
|
||||
queryKey,
|
||||
queryFn,
|
||||
initialData: initialSession,
|
||||
});
|
||||
}
|
||||
|
||||
export function useRevalidateUserSession() {
|
||||
|
||||
Reference in New Issue
Block a user