Update labels and refine hooks for teams and billing modules
This commit modifies several language labels and refines hooks related to 'teams' and 'billing' modules for better clarity and consistency. It also includes the deletion of unused locale files and package dependencies transfered to 'peerDependencies'. Lastly, it introduces minor enhancements in server command, error logging functionality, and scripts to interact with Stripe.
This commit is contained in:
@@ -1,16 +1,15 @@
|
||||
import { useMutation } from '@tanstack/react-query';
|
||||
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
||||
|
||||
import { useSupabase } from './use-supabase';
|
||||
import { useRevalidateUserSession } from './use-user-session';
|
||||
|
||||
export function useSignOut() {
|
||||
const client = useSupabase();
|
||||
const revalidateUserSession = useRevalidateUserSession();
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
return useMutation({
|
||||
mutationFn: async () => {
|
||||
await client.auth.signOut();
|
||||
await revalidateUserSession();
|
||||
await queryClient.invalidateQueries();
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ type Params = UserAttributes & { redirectTo: string };
|
||||
|
||||
export function useUpdateUser() {
|
||||
const client = useSupabase();
|
||||
const mutationKey = ['auth', 'update-user'];
|
||||
const mutationKey = ['supabase:user'];
|
||||
|
||||
const mutationFn = async (attributes: Params) => {
|
||||
const { redirectTo, ...params } = attributes;
|
||||
@@ -17,10 +17,14 @@ export function useUpdateUser() {
|
||||
emailRedirectTo: redirectTo,
|
||||
});
|
||||
|
||||
console.log(response);
|
||||
|
||||
if (response.error) {
|
||||
throw response.error;
|
||||
}
|
||||
|
||||
console.log('response.data:', response.data);
|
||||
|
||||
return response.data;
|
||||
};
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import { useSupabase } from './use-supabase';
|
||||
export function useUser() {
|
||||
const client = useSupabase();
|
||||
const router = useRouter();
|
||||
const queryKey = ['user'];
|
||||
const queryKey = ['supabase:user'];
|
||||
|
||||
const queryFn = async () => {
|
||||
const response = await client.auth.getUser();
|
||||
|
||||
Reference in New Issue
Block a user