fix: workspace draft issues count (#5809)
This commit is contained in:
parent
7e334203f1
commit
286ab7f650
1 changed files with 21 additions and 0 deletions
|
|
@ -252,6 +252,13 @@ export class WorkspaceDraftIssues implements IWorkspaceDraftIssues {
|
|||
runInAction(() => {
|
||||
this.addIssue([response]);
|
||||
update(this.issueMapIds, [workspaceSlug], (existingIssueIds = []) => [response.id, ...existingIssueIds]);
|
||||
// increase the count of issues in the pagination info
|
||||
if (this.paginationInfo?.total_count) {
|
||||
set(this, "paginationInfo", {
|
||||
...this.paginationInfo,
|
||||
total_count: this.paginationInfo.total_count + 1,
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -294,6 +301,13 @@ export class WorkspaceDraftIssues implements IWorkspaceDraftIssues {
|
|||
runInAction(() => {
|
||||
unset(this.issueMapIds[workspaceSlug], issueId);
|
||||
unset(this.issuesMap, issueId);
|
||||
// reduce the count of issues in the pagination info
|
||||
if (this.paginationInfo?.total_count) {
|
||||
set(this, "paginationInfo", {
|
||||
...this.paginationInfo,
|
||||
total_count: this.paginationInfo.total_count - 1,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
this.loader = undefined;
|
||||
|
|
@ -312,6 +326,13 @@ export class WorkspaceDraftIssues implements IWorkspaceDraftIssues {
|
|||
runInAction(() => {
|
||||
unset(this.issueMapIds[workspaceSlug], issueId);
|
||||
unset(this.issuesMap, issueId);
|
||||
// reduce the count of issues in the pagination info
|
||||
if (this.paginationInfo?.total_count) {
|
||||
set(this, "paginationInfo", {
|
||||
...this.paginationInfo,
|
||||
total_count: this.paginationInfo.total_count - 1,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
this.loader = undefined;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue