fix: cycle and module sidebar mutation fix (#3521)
* fix: cycle and module sidebar mutation * fix: cycle and module calendar drag n drop fix
This commit is contained in:
parent
3a4c893368
commit
2c67aced15
5 changed files with 21 additions and 12 deletions
|
|
@ -200,6 +200,7 @@ export class CycleIssues extends IssueHelperStore implements ICycleIssues {
|
|||
if (!cycleId) throw new Error("Cycle Id is required");
|
||||
|
||||
const response = await this.rootIssueStore.projectIssues.updateIssue(workspaceSlug, projectId, issueId, data);
|
||||
this.rootIssueStore.rootStore.cycle.fetchCycleDetails(workspaceSlug, projectId, cycleId);
|
||||
return response;
|
||||
} catch (error) {
|
||||
this.fetchIssues(workspaceSlug, projectId, "mutation", cycleId);
|
||||
|
|
@ -267,9 +268,7 @@ export class CycleIssues extends IssueHelperStore implements ICycleIssues {
|
|||
});
|
||||
|
||||
runInAction(() => {
|
||||
update(this.issues, cycleId, (cycleIssueIds = []) => {
|
||||
return uniq(concat(cycleIssueIds, issueIds));
|
||||
});
|
||||
update(this.issues, cycleId, (cycleIssueIds = []) => uniq(concat(cycleIssueIds, issueIds)));
|
||||
});
|
||||
issueIds.forEach((issueId) => {
|
||||
this.rootStore.issues.updateIssue(issueId, { cycle_id: cycleId });
|
||||
|
|
|
|||
|
|
@ -205,6 +205,7 @@ export class ModuleIssues extends IssueHelperStore implements IModuleIssues {
|
|||
if (!moduleId) throw new Error("Module Id is required");
|
||||
|
||||
const response = await this.rootIssueStore.projectIssues.updateIssue(workspaceSlug, projectId, issueId, data);
|
||||
this.rootIssueStore.rootStore.module.fetchModuleDetails(workspaceSlug, projectId, moduleId);
|
||||
return response;
|
||||
} catch (error) {
|
||||
this.fetchIssues(workspaceSlug, projectId, "mutation", moduleId);
|
||||
|
|
|
|||
|
|
@ -38,6 +38,8 @@ export interface IIssueRootStore {
|
|||
members: string[] | undefined;
|
||||
projects: string[] | undefined;
|
||||
|
||||
rootStore: RootStore;
|
||||
|
||||
issues: IIssueStore;
|
||||
|
||||
state: IStateStore;
|
||||
|
|
@ -87,6 +89,8 @@ export class IssueRootStore implements IIssueRootStore {
|
|||
members: string[] | undefined = undefined;
|
||||
projects: string[] | undefined = undefined;
|
||||
|
||||
rootStore: RootStore;
|
||||
|
||||
issues: IIssueStore;
|
||||
|
||||
state: IStateStore;
|
||||
|
|
@ -136,6 +140,8 @@ export class IssueRootStore implements IIssueRootStore {
|
|||
projects: observable,
|
||||
});
|
||||
|
||||
this.rootStore = rootStore;
|
||||
|
||||
autorun(() => {
|
||||
if (rootStore.user.currentUser?.id) this.currentUserId = rootStore.user.currentUser?.id;
|
||||
if (rootStore.app.router.workspaceSlug) this.workspaceSlug = rootStore.app.router.workspaceSlug;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue