Skip to content
This repository has been archived by the owner on Mar 25, 2023. It is now read-only.

Commit

Permalink
fix(tags): change the order of requests in the update action of the t…
Browse files Browse the repository at this point in the history
…ag (#1010)

PR Close #1010
  • Loading branch information
tamazlykar authored Apr 11, 2018
1 parent f776967 commit 94d1a6d
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/app/tags/tags.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ export abstract class TagsComponent<T extends Taggable> {
return;
}

Observable.of(null)
this.tagService.create({
resourceIds: tagEditAction.oldTag.resourceid,
resourceType: tagEditAction.oldTag.resourcetype,
'tags[0].key': tagEditAction.newTag.key,
'tags[0].value': tagEditAction.newTag.value
})
.switchMap(() => {
return this.tagService.remove({
resourceIds: tagEditAction.oldTag.resourceid,
Expand All @@ -52,14 +57,6 @@ export abstract class TagsComponent<T extends Taggable> {
'tags[0].value': tagEditAction.oldTag.value
});
})
.switchMap(() => {
return this.tagService.create({
resourceIds: tagEditAction.oldTag.resourceid,
resourceType: tagEditAction.oldTag.resourcetype,
'tags[0].key': tagEditAction.newTag.key,
'tags[0].value': tagEditAction.newTag.value
});
})
.subscribe(
res => this.onTagEdit.emit(tagEditAction),
error => this.onError(error)
Expand Down

0 comments on commit 94d1a6d

Please sign in to comment.