mirror of
https://github.com/makeplane/plane.git
synced 2025-12-25 16:19:43 +01:00
remove issue from cycle while changing cycle (#5246)
This commit is contained in:
@@ -892,9 +892,14 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore {
|
||||
|
||||
addCycleToIssue = async (workspaceSlug: string, projectId: string, cycleId: string, issueId: string) => {
|
||||
const issueCycleId = this.rootIssueStore.issues.getIssueById(issueId)?.cycle_id;
|
||||
|
||||
if (issueCycleId === cycleId) return;
|
||||
|
||||
try {
|
||||
// Update issueIds from current store
|
||||
runInAction(() => {
|
||||
// If cycle Id before update is the same as current cycle Id then, remove issueId from list
|
||||
if (this.cycleId === issueCycleId) this.removeIssueFromList(issueId);
|
||||
// If cycle Id is the current cycle Id, then, add issue to list of issueIds
|
||||
if (this.cycleId === cycleId) this.addIssueToList(issueId);
|
||||
// For Each issue update cycle Id by calling current store's update Issue, without making an API call
|
||||
|
||||
Reference in New Issue
Block a user