[WEB-3863] fix: handled error handling for link editing #6968
This commit is contained in:
parent
101994840a
commit
d86ac368a4
1 changed files with 19 additions and 8 deletions
|
|
@ -121,17 +121,28 @@ export class IssueLinkStore implements IIssueLinkStore {
|
|||
linkId: string,
|
||||
data: Partial<TIssueLink>
|
||||
) => {
|
||||
runInAction(() => {
|
||||
Object.keys(data).forEach((key) => {
|
||||
set(this.linkMap, [linkId, key], data[key as keyof TIssueLink]);
|
||||
const initialData = { ...this.linkMap[linkId] };
|
||||
try {
|
||||
runInAction(() => {
|
||||
Object.keys(data).forEach((key) => {
|
||||
set(this.linkMap, [linkId, key], data[key as keyof TIssueLink]);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
const response = await this.issueService.updateIssueLink(workspaceSlug, projectId, issueId, linkId, data);
|
||||
const response = await this.issueService.updateIssueLink(workspaceSlug, projectId, issueId, linkId, data);
|
||||
|
||||
// fetching activity
|
||||
this.rootIssueDetailStore.activity.fetchActivities(workspaceSlug, projectId, issueId);
|
||||
return response;
|
||||
// fetching activity
|
||||
this.rootIssueDetailStore.activity.fetchActivities(workspaceSlug, projectId, issueId);
|
||||
return response;
|
||||
} catch (error) {
|
||||
console.error("error", error);
|
||||
runInAction(() => {
|
||||
Object.keys(initialData).forEach((key) => {
|
||||
set(this.linkMap, [linkId, key], initialData[key as keyof TIssueLink]);
|
||||
});
|
||||
});
|
||||
return initialData;
|
||||
}
|
||||
};
|
||||
|
||||
removeLink = async (workspaceSlug: string, projectId: string, issueId: string, linkId: string) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue