fix: delete action mutation (#5315)

This commit is contained in:
Anmol Singh Bhatia
2024-08-06 16:42:13 +05:30
committed by GitHub
parent 9715922fc1
commit 3f9523804b
5 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -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);
});
});
+1 -1
View File
@@ -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);
});
});
};
+1 -1
View File
@@ -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(() => {
+1 -1
View File
@@ -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);
});
});
};
+1 -1
View File
@@ -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");