diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 1760b426..48ad9fee 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -3,8 +3,8 @@ import type { Metadata } from "next" import { UserProvider } from "@auth0/nextjs-auth0/client" import { config as fontAwesomeConfig } from "@fortawesome/fontawesome-svg-core" import { CssBaseline } from "@mui/material" -import ThemeRegistry from "@/common/theme/ThemeRegistry" -import ErrorHandler from "@/common/errors/client/ErrorHandler" +import ThemeRegistry from "../common/theme/ThemeRegistry" +import ErrorHandler from "../common/errors/client/ErrorHandler" import "@fortawesome/fontawesome-svg-core/styles.css" fontAwesomeConfig.autoAddCss = false diff --git a/src/common/errors/client/ErrorHandler.tsx b/src/common/errors/client/ErrorHandler.tsx index 20ba19a3..61260578 100644 --- a/src/common/errors/client/ErrorHandler.tsx +++ b/src/common/errors/client/ErrorHandler.tsx @@ -1,7 +1,7 @@ "use client" import { SWRConfig } from "swr" -import { FetcherError } from "@/common/utils/fetcher" +import { FetcherError } from "@/common" export default function ErrorHandler({ children diff --git a/src/common/mutex/SessionMutexFactory.ts b/src/common/mutex/SessionMutexFactory.ts index 72554464..c84b02de 100644 --- a/src/common/mutex/SessionMutexFactory.ts +++ b/src/common/mutex/SessionMutexFactory.ts @@ -1,7 +1,7 @@ import IKeyedMutexFactory from "./IKeyedMutexFactory" import IMutex from "./IMutex" import IMutexFactory from "./IMutexFactory" -import ISession from "@/common/session/ISession" +import { ISession } from "@/common" export default class SessionMutexFactory implements IMutexFactory { private readonly mutexFactory: IKeyedMutexFactory diff --git a/src/features/auth/domain/oAuthToken/OAuthTokenRepository.ts b/src/features/auth/domain/oAuthToken/OAuthTokenRepository.ts index a28bc29a..2a11b700 100644 --- a/src/features/auth/domain/oAuthToken/OAuthTokenRepository.ts +++ b/src/features/auth/domain/oAuthToken/OAuthTokenRepository.ts @@ -1,6 +1,4 @@ -import ZodJSONCoder from "../../../../common/utils/ZodJSONCoder" -import IUserDataRepository from "@/common/userData/IUserDataRepository" -import { UnauthorizedError } from "../../../../common/errors" +import { IUserDataRepository, UnauthorizedError, ZodJSONCoder } from "../../../../common" import IOAuthTokenRepository from "./IOAuthTokenRepository" import OAuthToken, { OAuthTokenSchema } from "./OAuthToken" diff --git a/src/features/hooks/data/GitHubPullRequestCommentRepository.ts b/src/features/hooks/data/GitHubPullRequestCommentRepository.ts index 59b60d62..3e074d59 100644 --- a/src/features/hooks/data/GitHubPullRequestCommentRepository.ts +++ b/src/features/hooks/data/GitHubPullRequestCommentRepository.ts @@ -1,4 +1,4 @@ -import IGitHubClient from "@/common/github/IGitHubClient" +import { IGitHubClient } from "@/common" import IPullRequestCommentRepository, { GetPullRequestCommentsOperation, AddPullRequestCommentOperation, diff --git a/src/features/projects/data/GitHubProjectDataSource.ts b/src/features/projects/data/GitHubProjectDataSource.ts index a66a6f27..f001549e 100644 --- a/src/features/projects/data/GitHubProjectDataSource.ts +++ b/src/features/projects/data/GitHubProjectDataSource.ts @@ -1,4 +1,4 @@ -import IGitHubClient from "@/common/github/IGitHubClient" +import { IGitHubClient } from "@/common" import { Project, IProjectConfig, diff --git a/src/features/projects/domain/ProjectRepository.ts b/src/features/projects/domain/ProjectRepository.ts index 1fb96b0c..45a494d2 100644 --- a/src/features/projects/domain/ProjectRepository.ts +++ b/src/features/projects/domain/ProjectRepository.ts @@ -1,20 +1,24 @@ -import { ZodJSONCoder, ISession, IUserDataRepository } from "../../../common" +import { IUserDataRepository, ZodJSONCoder } from "../../../common" import IProjectRepository from "./IProjectRepository" import Project, { ProjectSchema } from "./Project" +interface IUserIDReader { + getUserId(): Promise +} + type Repository = IUserDataRepository export default class ProjectRepository implements IProjectRepository { - private readonly session: ISession + private readonly userIDReader: IUserIDReader private readonly repository: Repository - constructor(session: ISession, repository: Repository) { - this.session = session + constructor(userIDReader: IUserIDReader, repository: Repository) { + this.userIDReader = userIDReader this.repository = repository } async get(): Promise { - const userId = await this.session.getUserId() + const userId = await this.userIDReader.getUserId() const string = await this.repository.get(userId) if (!string) { return undefined @@ -23,13 +27,13 @@ export default class ProjectRepository implements IProjectRepository { } async set(projects: Project[]): Promise { - const userId = await this.session.getUserId() + const userId = await this.userIDReader.getUserId() const string = ZodJSONCoder.encode(ProjectSchema.array(), projects) await this.repository.set(userId, string) } async delete(): Promise { - const userId = await this.session.getUserId() + const userId = await this.userIDReader.getUserId() await this.repository.delete(userId) } }