mirror of
https://github.com/makeplane/plane.git
synced 2026-04-28 12:01:54 -05:00
fix: delete action mutation (#5315)
This commit is contained in:
committed by
GitHub
parent
9715922fc1
commit
3f9523804b
@@ -551,9 +551,9 @@ export class CycleStore implements ICycleStore {
|
||||
deleteCycle = async (workspaceSlug: string, projectId: string, cycleId: string) =>
|
||||
await this.cycleService.deleteCycle(workspaceSlug, projectId, cycleId).then(() => {
|
||||
runInAction(() => {
|
||||
this.rootStore.favorite.removeFavoriteFromStore(cycleId);
|
||||
delete this.cycleMap[cycleId];
|
||||
delete this.activeCycleIdMap[cycleId];
|
||||
if (this.rootStore.favorite.entityMap[cycleId]) this.rootStore.favorite.removeFavoriteFromStore(cycleId);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -405,7 +405,7 @@ export class ModulesStore implements IModuleStore {
|
||||
await this.moduleService.deleteModule(workspaceSlug, projectId, moduleId).then(() => {
|
||||
runInAction(() => {
|
||||
delete this.moduleMap[moduleId];
|
||||
this.rootStore.favorite.removeFavoriteFromStore(moduleId);
|
||||
if (this.rootStore.favorite.entityMap[moduleId]) this.rootStore.favorite.removeFavoriteFromStore(moduleId);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
@@ -261,7 +261,7 @@ export class ProjectPageStore implements IProjectPageStore {
|
||||
await this.service.remove(workspaceSlug, projectId, pageId);
|
||||
runInAction(() => {
|
||||
unset(this.data, [pageId]);
|
||||
this.rootStore.favorite.removeFavoriteFromStore(pageId);
|
||||
if (this.rootStore.favorite.entityMap[pageId]) this.rootStore.favorite.removeFavoriteFromStore(pageId);
|
||||
});
|
||||
} catch (error) {
|
||||
runInAction(() => {
|
||||
|
||||
@@ -271,7 +271,7 @@ export class ProjectViewStore implements IProjectViewStore {
|
||||
await this.viewService.deleteView(workspaceSlug, projectId, viewId).then(() => {
|
||||
runInAction(() => {
|
||||
delete this.viewMap[viewId];
|
||||
this.rootStore.favorite.removeFavoriteFromStore(viewId);
|
||||
if (this.rootStore.favorite.entityMap[viewId]) this.rootStore.favorite.removeFavoriteFromStore(viewId);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
@@ -401,7 +401,7 @@ export class ProjectStore implements IProjectStore {
|
||||
await this.projectService.deleteProject(workspaceSlug, projectId);
|
||||
runInAction(() => {
|
||||
delete this.projectMap[projectId];
|
||||
this.rootStore.favorite.removeFavoriteFromStore(projectId);
|
||||
if (this.rootStore.favorite.entityMap[projectId]) this.rootStore.favorite.removeFavoriteFromStore(projectId);
|
||||
});
|
||||
} catch (error) {
|
||||
console.log("Failed to delete project from project store");
|
||||
|
||||
Reference in New Issue
Block a user