mirror of
https://github.com/makeplane/plane.git
synced 2026-07-10 04:25:24 +02:00
refactor: migrate services (project-page, project-page-version) from apps/web to @plane/services
This commit is contained in:
@@ -31,7 +31,7 @@ import { EPageStoreType, usePage, usePageStore } from "@/plane-web/hooks/store";
|
||||
// plane web services
|
||||
import { WorkspaceService } from "@/services/workspace.service";
|
||||
// services
|
||||
import { ProjectPageService, ProjectPageVersionService } from "@/services/page";
|
||||
import { ProjectPageService, ProjectPageVersionService } from "@plane/services";
|
||||
import type { Route } from "./+types/page";
|
||||
const workspaceService = new WorkspaceService();
|
||||
const projectPageService = new ProjectPageService();
|
||||
|
||||
@@ -17,7 +17,7 @@ import { filterPagesByPageType, getPageName, orderPages, shouldFilterPage } from
|
||||
// plane web store
|
||||
import type { RootStore } from "@/plane-web/store/root.store";
|
||||
// services
|
||||
import { ProjectPageService } from "@/services/page";
|
||||
import { ProjectPageService } from "@plane/services";
|
||||
// store
|
||||
import type { CoreRootStore } from "../root.store";
|
||||
import type { TProjectPage } from "./project-page";
|
||||
|
||||
@@ -12,14 +12,15 @@ import type { TPage } from "@plane/types";
|
||||
// plane web store
|
||||
import type { RootStore } from "@/plane-web/store/root.store";
|
||||
// services
|
||||
import { ProjectPageService } from "@/services/page";
|
||||
const projectPageService = new ProjectPageService();
|
||||
import { ProjectPageService } from "@plane/services";
|
||||
// store
|
||||
import { BasePage } from "./base-page";
|
||||
import type { TPageInstance } from "./base-page";
|
||||
|
||||
export type TProjectPage = TPageInstance;
|
||||
|
||||
const projectPageService = new ProjectPageService();
|
||||
|
||||
export class ProjectPage extends BasePage implements TProjectPage {
|
||||
constructor(store: RootStore, page: TPage) {
|
||||
// required fields for API calls
|
||||
|
||||
@@ -25,3 +25,4 @@ export * from "./file";
|
||||
export * from "./label";
|
||||
export * from "./state";
|
||||
export * from "./issue";
|
||||
export * from "./page";
|
||||
|
||||
@@ -4,5 +4,5 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
export * from "./project-page-version.service";
|
||||
export * from "./project-page.service";
|
||||
export * from "./project-page-version.service";
|
||||
@@ -9,7 +9,7 @@ import { API_BASE_URL } from "@plane/constants";
|
||||
import type { TPageVersion } from "@plane/types";
|
||||
// helpers
|
||||
// services
|
||||
import { APIService } from "@/services/api.service";
|
||||
import { APIService } from "../api.service";
|
||||
|
||||
export class ProjectPageVersionService extends APIService {
|
||||
constructor() {
|
||||
@@ -9,16 +9,11 @@ import { API_BASE_URL } from "@plane/constants";
|
||||
import type { TDocumentPayload, TPage } from "@plane/types";
|
||||
// helpers
|
||||
// services
|
||||
import { APIService } from "@/services/api.service";
|
||||
import { FileUploadService } from "@/services/file-upload.service";
|
||||
import { APIService } from "../api.service";
|
||||
|
||||
export class ProjectPageService extends APIService {
|
||||
private fileUploadService: FileUploadService;
|
||||
|
||||
constructor() {
|
||||
super(API_BASE_URL);
|
||||
// upload service
|
||||
this.fileUploadService = new FileUploadService();
|
||||
}
|
||||
|
||||
async fetchAll(workspaceSlug: string, projectId: string): Promise<TPage[]> {
|
||||
Reference in New Issue
Block a user