correcao na organiz

This commit is contained in:
2026-04-02 11:53:45 +00:00
parent 3132bb73a2
commit 44aac9ac2d
4 changed files with 49 additions and 33 deletions

View File

@@ -2,6 +2,7 @@ import React, { useState, useEffect, useCallback, useMemo } from 'react';
import type { AppUser, UserRole } from '../types';
import { AuthContext } from './AuthContextType';
import { getUser } from '../main';
import { setApiOrganizationId } from '../services/api';
interface AuthProviderProps {
children: React.ReactNode;
@@ -17,6 +18,9 @@ const defaultUser: AppUser = {
updatedAt: new Date().toISOString()
};
const DEFAULT_ORGANIZATION_ID = 'default-org';
const DEFAULT_ORGANIZATION_NAME = 'Organização Padrão';
export const AuthProvider: React.FC<AuthProviderProps> = ({ children }) => {
const [appUser, setAppUser] = useState<AppUser | null>(null);
@@ -27,6 +31,8 @@ export const AuthProvider: React.FC<AuthProviderProps> = ({ children }) => {
} else {
setAppUser(defaultUser);
}
setApiOrganizationId(DEFAULT_ORGANIZATION_ID, DEFAULT_ORGANIZATION_NAME);
}, []);
const isDeveloper = useCallback(() => false, []);