[WEB-2896] fix: mutation problem with issue properties while accepting an intake issue. (#6277)
This commit is contained in:
parent
ed64168ca7
commit
a5c1282e52
2 changed files with 6 additions and 3 deletions
|
|
@ -64,9 +64,10 @@ export const updatePersistentLayer = async (issueIds: string | string[]) => {
|
|||
issueIds.forEach(async (issueId) => {
|
||||
const dbIssue = await persistence.getIssue(issueId);
|
||||
const issue = rootStore.issue.issues.getIssueById(issueId);
|
||||
const updatedIssue = dbIssue ? { ...dbIssue, ...issue } : issue;
|
||||
|
||||
if (issue) {
|
||||
addIssueToPersistanceLayer(issue);
|
||||
if (updatedIssue) {
|
||||
addIssueToPersistanceLayer(updatedIssue);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -98,7 +98,9 @@ export class InboxIssueStore implements IInboxIssueStore {
|
|||
|
||||
// If issue accepted sync issue to local db
|
||||
if (status === EInboxIssueStatus.ACCEPTED) {
|
||||
addIssueToPersistanceLayer({ ...this.issue, ...inboxIssue.issue });
|
||||
const updatedIssue = { ...this.issue, ...inboxIssue.issue };
|
||||
this.store.issue.issues.addIssue([updatedIssue]);
|
||||
await addIssueToPersistanceLayer(updatedIssue);
|
||||
}
|
||||
} catch {
|
||||
runInAction(() => set(this, "status", previousData.status));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue