Commit 99e51c36 authored by Lorenzo Trujillo Rojas's avatar Lorenzo Trujillo Rojas
Browse files

Se agregó el repositorio de perfil al contexto general

parent ed1dae0b
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -15,6 +15,10 @@ import { TravelRepository } from "../../domain/repositories/travel_repository";
import { RouteRepository } from "../../domain/repositories/route_repository";
import { RouteDataSourceDev } from "../../infrastructure/datasource/dev/route_datasource";
import { RouteRepositoryImpl } from "../../infrastructure/repositories/route_repository";
import { StateDataSourceProd } from "../../infrastructure/datasource/prod/state_datasource";
import { ProfileRepository } from "../../profile/domain/repositories/profile_repository";
import { ProfileDataSourceDev } from "../../profile/infrastructure/datasources/dev/profile_datasource";
import { ProfileRepositoryImpl } from "../../profile/infrastructure/repositories/profile_repository";

type DataContextType = {
    statesRepository: StateRepository | null;
@@ -22,6 +26,7 @@ type DataContextType = {
    activityRepository: ActivityRepository | null;
    travelRepository: TravelRepository | null;
    routeRepository: RouteRepository | null;
    profileRepository: ProfileRepository | null;
};

type DataContextProviderProps = PropsWithChildren<{}>;
@@ -31,7 +36,8 @@ const DataContext = createContext<DataContextType>({
    authRepository: null,
    activityRepository: null,
    travelRepository: null,
    routeRepository: null
    routeRepository: null,
    profileRepository: null
});

export const DataContextProvider = ({ children }: DataContextProviderProps) => {
@@ -45,13 +51,16 @@ export const DataContextProvider = ({ children }: DataContextProviderProps) => {
    const travelRepository = new TravelRepositoryImpl(travelDatasource);
    const routeDatasource = new RouteDataSourceDev();
    const routeRepository = new RouteRepositoryImpl(routeDatasource);
    const profileDataSource = new ProfileDataSourceDev();
    const profileRepository = new ProfileRepositoryImpl(profileDataSource);
    
    const value = {
        statesRepository,
        authRepository,
        activityRepository,
        travelRepository,
        routeRepository
        routeRepository,
        profileRepository
    };

    return (