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:
gpt-engineer-app[bot] 2025-06-23 21:43:25 +00:00
parent 7ba2d39ab0
commit 9a14d62b1a
3 changed files with 5 additions and 7 deletions

View File

@ -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:

View File

@ -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 () => {

View File

@ -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 () => {