Fix: Use useAuthStore in multiple components
Replaced incorrect import of `authStore` with `useAuthStore` in `MeuCadastroForm.tsx`, `useProfileCompletion.ts`, and `CompleteProfile.tsx` to resolve TypeScript errors.
This commit is contained in:
parent
7ba2d39ab0
commit
9a14d62b1a
@ -5,7 +5,7 @@ import { Label } from "@/components/ui/label";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Select, SelectTrigger, SelectContent, SelectItem } from "@/components/ui/select";
|
||||
import { useToast } from "@/hooks/use-toast";
|
||||
import { authStore } from "@/stores/authStore";
|
||||
import { useAuthStore } from "@/stores/authStore";
|
||||
import { supabase } from "@/integrations/supabase/client";
|
||||
|
||||
// Campos que vêm da tabela usuarios:
|
||||
|
||||
@ -1,11 +1,10 @@
|
||||
|
||||
import { useState, useEffect } from 'react';
|
||||
import { supabase } from '@/integrations/supabase/client';
|
||||
import { authStore } from '@/stores/authStore';
|
||||
import { useAuthStore } from '@/stores/authStore';
|
||||
|
||||
export const useProfileCompletion = (userEmail: string) => {
|
||||
const [isChecking, setIsChecking] = useState(true);
|
||||
const setProfileComplete = authStore((state) => state.setProfileComplete);
|
||||
const setProfileComplete = useAuthStore((state) => state.setProfileComplete);
|
||||
|
||||
useEffect(() => {
|
||||
const checkProfileCompletion = async () => {
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
|
||||
import { useState, useEffect } from 'react';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
@ -7,7 +6,7 @@ import { Input } from "@/components/ui/input";
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { toast } from "sonner";
|
||||
import { supabase } from '@/integrations/supabase/client';
|
||||
import { authStore } from '@/stores/authStore';
|
||||
import { useAuthStore } from '@/stores/authStore';
|
||||
import { sendNewUserWebhook } from '@/services/newUserWebhookService';
|
||||
import { formatarWhatsapp } from '@/utils/whatsappFormatter';
|
||||
|
||||
@ -20,7 +19,7 @@ const CompleteProfile = () => {
|
||||
const [userEmail, setUserEmail] = useState('');
|
||||
const [userId, setUserId] = useState('');
|
||||
|
||||
const setProfileComplete = authStore((state) => state.setProfileComplete);
|
||||
const setProfileComplete = useAuthStore((state) => state.setProfileComplete);
|
||||
|
||||
useEffect(() => {
|
||||
const getUserData = async () => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user