diff --git a/web/core/hooks/use-page-description.ts b/web/core/hooks/use-page-description.ts index c96aa9649..43f602800 100644 --- a/web/core/hooks/use-page-description.ts +++ b/web/core/hooks/use-page-description.ts @@ -6,9 +6,9 @@ import { EditorRefApi, generateJSONfromHTML } from "@plane/editor-core"; // hooks import useReloadConfirmations from "@/hooks/use-reload-confirmation"; // services -import { PageService } from "@/services/page.service"; +import { ProjectPageService } from "@/services/page"; import { IPageStore } from "@/store/pages/page.store"; -const pageService = new PageService(); +const projectPageService = new ProjectPageService(); type Props = { editorRef: React.RefObject; @@ -32,7 +32,7 @@ export const usePageDescription = (props: Props) => { const { data: descriptionYJS, mutate: mutateDescriptionYJS } = useSWR( workspaceSlug && projectId && pageId ? `PAGE_DESCRIPTION_${workspaceSlug}_${projectId}_${pageId}` : null, workspaceSlug && projectId && pageId - ? () => pageService.fetchDescriptionYJS(workspaceSlug.toString(), projectId.toString(), pageId.toString()) + ? () => projectPageService.fetchDescriptionYJS(workspaceSlug.toString(), projectId.toString(), pageId.toString()) : null, { revalidateOnFocus: false, diff --git a/web/core/services/page/index.ts b/web/core/services/page/index.ts new file mode 100644 index 000000000..d89b175d6 --- /dev/null +++ b/web/core/services/page/index.ts @@ -0,0 +1 @@ +export * from "./project-page.service"; diff --git a/web/core/services/page.service.ts b/web/core/services/page/project-page.service.ts similarity index 98% rename from web/core/services/page.service.ts rename to web/core/services/page/project-page.service.ts index 0b0d39f24..67fe4525c 100644 --- a/web/core/services/page.service.ts +++ b/web/core/services/page/project-page.service.ts @@ -5,7 +5,7 @@ import { API_BASE_URL } from "@/helpers/common.helper"; // services import { APIService } from "@/services/api.service"; -export class PageService extends APIService { +export class ProjectPageService extends APIService { constructor() { super(API_BASE_URL); } diff --git a/web/core/store/pages/page.store.ts b/web/core/store/pages/page.store.ts index 9c1d6649f..7878ce83d 100644 --- a/web/core/store/pages/page.store.ts +++ b/web/core/store/pages/page.store.ts @@ -6,7 +6,7 @@ import { TLogoProps, TPage } from "@plane/types"; import { EPageAccess } from "@/constants/page"; import { EUserProjectRoles } from "@/constants/project"; // services -import { PageService } from "@/services/page.service"; +import { ProjectPageService } from "@/services/page"; import { RootStore } from "../root.store"; export type TLoader = "submitting" | "submitted" | "saved"; @@ -69,7 +69,7 @@ export class PageStore implements IPageStore { // reactions disposers: Array<() => void> = []; // services - pageService: PageService; + pageService: ProjectPageService; constructor( private store: RootStore, @@ -144,7 +144,7 @@ export class PageStore implements IPageStore { removeFromFavorites: action, }); - this.pageService = new PageService(); + this.pageService = new ProjectPageService(); const titleDisposer = reaction( () => this.name, diff --git a/web/core/store/pages/project-page.store.ts b/web/core/store/pages/project-page.store.ts index a304e57c3..46369dcd4 100644 --- a/web/core/store/pages/project-page.store.ts +++ b/web/core/store/pages/project-page.store.ts @@ -7,7 +7,7 @@ import { TPage, TPageFilters, TPageNavigationTabs } from "@plane/types"; // helpers import { filterPagesByPageType, getPageName, orderPages, shouldFilterPage } from "@/helpers/page.helper"; // services -import { PageService } from "@/services/page.service"; +import { ProjectPageService } from "@/services/page"; // store import { IPageStore, PageStore } from "@/store/pages/page.store"; import { RootStore } from "../root.store"; @@ -48,7 +48,7 @@ export class ProjectPageStore implements IProjectPageStore { sortBy: "desc", }; // service - service: PageService; + service: ProjectPageService; constructor(private store: RootStore) { makeObservable(this, { @@ -67,7 +67,7 @@ export class ProjectPageStore implements IProjectPageStore { removePage: action, }); // service - this.service = new PageService(); + this.service = new ProjectPageService(); // initialize display filters of the current project reaction( () => this.store.router.projectId,