forked from github/plane
fix: removing the issue from the issue root store while we are deleting from the issue bulk delete modal (#3470)
This commit is contained in:
@@ -24,6 +24,7 @@ export interface IProjectIssues {
|
||||
updateIssue: (workspaceSlug: string, projectId: string, issueId: string, data: Partial<TIssue>) => Promise<TIssue>;
|
||||
removeIssue: (workspaceSlug: string, projectId: string, issueId: string) => Promise<TIssue>;
|
||||
quickAddIssue: (workspaceSlug: string, projectId: string, data: TIssue) => Promise<TIssue>;
|
||||
removeBulkIssues: (workspaceSlug: string, projectId: string, issueIds: string[]) => Promise<void>;
|
||||
}
|
||||
|
||||
export class ProjectIssues extends IssueHelperStore implements IProjectIssues {
|
||||
@@ -53,6 +54,7 @@ export class ProjectIssues extends IssueHelperStore implements IProjectIssues {
|
||||
createIssue: action,
|
||||
updateIssue: action,
|
||||
removeIssue: action,
|
||||
removeBulkIssues: action,
|
||||
quickAddIssue: action,
|
||||
});
|
||||
// root store
|
||||
@@ -185,4 +187,22 @@ export class ProjectIssues extends IssueHelperStore implements IProjectIssues {
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
|
||||
removeBulkIssues = async (workspaceSlug: string, projectId: string, issueIds: string[]) => {
|
||||
try {
|
||||
runInAction(() => {
|
||||
issueIds.forEach((issueId) => {
|
||||
pull(this.issues[projectId], issueId);
|
||||
this.rootStore.issues.removeIssue(issueId);
|
||||
});
|
||||
});
|
||||
|
||||
const response = await this.issueService.bulkDeleteIssues(workspaceSlug, projectId, { issue_ids: issueIds });
|
||||
|
||||
return response;
|
||||
} catch (error) {
|
||||
this.fetchIssues(workspaceSlug, projectId, "mutation");
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -164,8 +164,6 @@ export class WorkspaceIssuesFilter extends IssueFilterHelperStore implements IWo
|
||||
if (!viewId) throw new Error("View id is required");
|
||||
const issueFilters = this.getIssueFilters(viewId);
|
||||
|
||||
console.log("issueFilters", issueFilters);
|
||||
|
||||
if (!issueFilters || isEmpty(filters)) return;
|
||||
|
||||
const _filters = {
|
||||
|
||||
Reference in New Issue
Block a user