issue store changed

This commit is contained in:
Palanikannan M 2024-06-14 13:25:19 +05:30
parent ea44c2b3fb
commit cd278a2db5
2 changed files with 23 additions and 1 deletions

View File

@ -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

View File

@ -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<TIssue>) => Promise<TIssue>;
updateIssue: (workspaceSlug: string, projectId: string, issueId: string, data: Partial<TIssue>) => Promise<void>;
updateIssueDescription: (
workspaceSlug: string,
projectId: string,
issueId: string,
data: TIssueDescription
) => Promise<void>;
archiveIssue: (workspaceSlug: string, projectId: string, issueId: string) => Promise<void>;
quickAddIssue: (workspaceSlug: string, projectId: string, data: TIssue) => Promise<TIssue | undefined>;
removeBulkIssues: (workspaceSlug: string, projectId: string, issueIds: string[]) => Promise<void>;