From 94d1a6d783d6e1741db032dc3b5b1e9a0fc0557d Mon Sep 17 00:00:00 2001 From: Daniil Tamazlykar Date: Wed, 11 Apr 2018 09:43:46 +0700 Subject: [PATCH] fix(tags): change the order of requests in the update action of the tag (#1010) PR Close #1010 --- src/app/tags/tags.component.ts | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/app/tags/tags.component.ts b/src/app/tags/tags.component.ts index c1319c43b8..c489ba87ee 100644 --- a/src/app/tags/tags.component.ts +++ b/src/app/tags/tags.component.ts @@ -43,7 +43,12 @@ export abstract class TagsComponent { 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, @@ -52,14 +57,6 @@ export abstract class TagsComponent { '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)