From 2066fd69f28b11b37db245acc2fd178170a090d2 Mon Sep 17 00:00:00 2001 From: leejinho Date: Wed, 29 Jan 2020 15:09:41 +0900 Subject: [PATCH] api bugfix --- .../src/lib/services/common-api.service.ts | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/projects/ucap-webmessenger-api-common/src/lib/services/common-api.service.ts b/projects/ucap-webmessenger-api-common/src/lib/services/common-api.service.ts index fe0af076..ba116ebd 100644 --- a/projects/ucap-webmessenger-api-common/src/lib/services/common-api.service.ts +++ b/projects/ucap-webmessenger-api-common/src/lib/services/common-api.service.ts @@ -317,14 +317,21 @@ export class CommonApiService { public translationSave( req: TranslationSaveRequest ): Observable { - return this.httpClient - .post( - this.urls.translationSave, - {}, - { - params: encodeTranslationSave(req) + const httpReq = new HttpRequest( + 'POST', + this.urls.translationSave, + encodeTranslationSave(req), + { reportProgress: true } + ); + + return this.httpClient.request(httpReq).pipe( + filter(event => { + if (event instanceof HttpResponse) { + return true; } - ) - .pipe(map(res => decodeTranslationSave(res))); + return false; + }), + map(res => decodeTranslationSave((res as HttpResponse).body)) + ); } }