From cd278a2db5e41e707944640783e4ca8bb978a13b Mon Sep 17 00:00:00 2001 From: Palanikannan M Date: Fri, 14 Jun 2024 13:25:19 +0530 Subject: [PATCH] issue store changed --- .../store/issue/helpers/base-issues.store.ts | 16 ++++++++++++++++ web/core/store/issue/project/issue.store.ts | 8 +++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/web/core/store/issue/helpers/base-issues.store.ts b/web/core/store/issue/helpers/base-issues.store.ts index b06004761b..9597353d56 100644 --- a/web/core/store/issue/helpers/base-issues.store.ts +++ b/web/core/store/issue/helpers/base-issues.store.ts @@ -27,6 +27,7 @@ import { TGroupedIssueCount, TPaginationData, TBulkOperationsPayload, + TIssueDescription, } from "@plane/types"; import { ALL_ISSUES, EIssueLayoutTypes, ISSUE_PRIORITIES } from "@/constants/issue"; import { convertToISODateString } from "@/helpers/date-time.helper"; @@ -221,6 +222,7 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore { createIssue: action, updateIssue: action, + updateIssueDescription: action, createDraftIssue: action, updateDraftIssue: action, issueQuickAdd: action.bound, @@ -554,6 +556,20 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore { } } + updateIssueDescription = async ( + workspaceSlug: string, + projectId: string, + issueId: string, + data: TIssueDescription + ) => { + try { + this.rootIssueStore.issues.updateIssue(issueId, data); + await this.issueService.updateDescriptionBinary(workspaceSlug, projectId, issueId, data); + } catch (error) { + throw error; + } + } + /** * Similar to Create Issue but for creating Draft issues * @param workspaceSlug diff --git a/web/core/store/issue/project/issue.store.ts b/web/core/store/issue/project/issue.store.ts index 0136fe907c..d112f327fa 100644 --- a/web/core/store/issue/project/issue.store.ts +++ b/web/core/store/issue/project/issue.store.ts @@ -1,6 +1,6 @@ import { action, makeObservable, runInAction, } from "mobx"; // types -import { TIssue, TLoader, ViewFlags, IssuePaginationOptions, TIssuesResponse, TBulkOperationsPayload } from "@plane/types"; +import { TIssue, TLoader, ViewFlags, IssuePaginationOptions, TIssuesResponse, TBulkOperationsPayload, TIssueDescription } from "@plane/types"; // helpers // base class import { BaseIssuesStore, IBaseIssuesStore } from "../helpers/base-issues.store"; @@ -31,6 +31,12 @@ export interface IProjectIssues extends IBaseIssuesStore { createIssue: (workspaceSlug: string, projectId: string, data: Partial) => Promise; updateIssue: (workspaceSlug: string, projectId: string, issueId: string, data: Partial) => Promise; + updateIssueDescription: ( + workspaceSlug: string, + projectId: string, + issueId: string, + data: TIssueDescription + ) => Promise; archiveIssue: (workspaceSlug: string, projectId: string, issueId: string) => Promise; quickAddIssue: (workspaceSlug: string, projectId: string, data: TIssue) => Promise; removeBulkIssues: (workspaceSlug: string, projectId: string, issueIds: string[]) => Promise;