correcao na organiz
This commit is contained in:
@@ -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, []);
|
||||
|
||||
Reference in New Issue
Block a user