From fe77bbe6fe69b25cb43d18bf48a6ffeb46e7b248 Mon Sep 17 00:00:00 2001 From: GnsP Date: Wed, 7 Aug 2024 21:54:02 +0530 Subject: [PATCH] fix angularjs incorerct parsing of text response --- app/hydrator/controllers/create/toppanel-ctrl.js | 2 +- app/services/apps/my-apps-api.js | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/hydrator/controllers/create/toppanel-ctrl.js b/app/hydrator/controllers/create/toppanel-ctrl.js index 6f66ff5b49a..4336ae35afa 100644 --- a/app/hydrator/controllers/create/toppanel-ctrl.js +++ b/app/hydrator/controllers/create/toppanel-ctrl.js @@ -1164,7 +1164,7 @@ class HydratorPlusPlusTopPanelCtrl { this.myAppsApi.summarize({ namespace: this.$state.params.namespace, }, pipelineConfig).$promise.then((res) => { - summarySetter(res); + summarySetter(res.summary); }); } diff --git a/app/services/apps/my-apps-api.js b/app/services/apps/my-apps-api.js index d32bdb624c9..01bdf9aa16e 100644 --- a/app/services/apps/my-apps-api.js +++ b/app/services/apps/my-apps-api.js @@ -31,6 +31,14 @@ angular.module(PKG.name + '.services') delete: myHelpers.getConfig('DELETE', 'REQUEST', detailPath), list: myHelpers.getConfig('GET', 'REQUEST', listPath, true), get: myHelpers.getConfig('GET', 'REQUEST', detailPath), - summarize: myHelpers.getConfig('POST', 'REQUEST', basePath + '/summarize'), + summarize: myHelpers.getConfig('POST', 'REQUEST', basePath + '/summarize', + false, { + responseType: 'text', + transformResponse: function (data) { + return { + summary: data, + }; + }, + }), }); });