mirror of
https://github.com/makeplane/plane.git
synced 2026-07-10 12:37:13 +02:00
refactor: migrate services (estimate) from apps/web to @plane/services
This commit is contained in:
@@ -14,7 +14,7 @@ import type {
|
||||
TEstimateSystemKeys,
|
||||
} from "@plane/types";
|
||||
// plane web services
|
||||
import estimateService from "@/services/estimate.service";
|
||||
import { EstimateService } from "@plane/services";
|
||||
// store
|
||||
import type { IEstimatePoint } from "@/store/estimates/estimate-point";
|
||||
import { EstimatePoint } from "@/store/estimates/estimate-point";
|
||||
@@ -41,6 +41,8 @@ export interface IEstimate extends Omit<IEstimateType, "points"> {
|
||||
) => Promise<IEstimatePointType | undefined>;
|
||||
}
|
||||
|
||||
const estimateService = new EstimateService();
|
||||
|
||||
export class Estimate implements IEstimate {
|
||||
// data model observables
|
||||
id: string | undefined = undefined;
|
||||
|
||||
@@ -11,7 +11,7 @@ import { action, computed, makeObservable, observable, runInAction } from "mobx"
|
||||
// types
|
||||
import type { IEstimate, IEstimatePoint as IEstimatePointType } from "@plane/types";
|
||||
// plane web services
|
||||
import estimateService from "@/services/estimate.service";
|
||||
import { EstimateService } from "@plane/services";
|
||||
// store
|
||||
import type { CoreRootStore } from "@/store/root.store";
|
||||
|
||||
@@ -35,6 +35,8 @@ export interface IEstimatePoint extends IEstimatePointType {
|
||||
) => Promise<IEstimatePointType | undefined>;
|
||||
}
|
||||
|
||||
const estimateService = new EstimateService();
|
||||
|
||||
export class EstimatePoint implements IEstimatePoint {
|
||||
// data model observables
|
||||
id: string | undefined = undefined;
|
||||
|
||||
@@ -10,7 +10,7 @@ import { computedFn } from "mobx-utils";
|
||||
// types
|
||||
import type { IEstimate as IEstimateType, IEstimateFormData, TEstimateSystemKeys } from "@plane/types";
|
||||
// plane web services
|
||||
import estimateService from "@/services/estimate.service";
|
||||
import { EstimateService } from "@plane/services";
|
||||
// plane web store
|
||||
import type { IEstimate } from "@/plane-web/store/estimates/estimate";
|
||||
import { Estimate } from "@/plane-web/store/estimates/estimate";
|
||||
@@ -53,6 +53,8 @@ export interface IProjectEstimateStore {
|
||||
deleteEstimate: (workspaceSlug: string, projectId: string, estimateId: string) => Promise<void>;
|
||||
}
|
||||
|
||||
const estimateService = new EstimateService();
|
||||
|
||||
export class ProjectEstimateStore implements IProjectEstimateStore {
|
||||
// observables
|
||||
loader: TEstimateLoader = undefined;
|
||||
|
||||
@@ -11,7 +11,7 @@ import { API_BASE_URL } from "@plane/constants";
|
||||
import type { IEstimate, IEstimateFormData, IEstimatePoint } from "@plane/types";
|
||||
// helpers
|
||||
// services
|
||||
import { APIService } from "@/services/api.service";
|
||||
import { APIService } from "../api.service";
|
||||
|
||||
export class EstimateService extends APIService {
|
||||
constructor() {
|
||||
Reference in New Issue
Block a user