From 5a32912a7b4fa30fc33ed538d4720032dd932f89 Mon Sep 17 00:00:00 2001 From: Jayasanka Date: Wed, 30 Oct 2019 22:03:24 +0530 Subject: [PATCH] Get updated data from payload in Application update in APPM UI --- .../list-apps/AppDetailsDrawer/AppDetailsDrawer.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/AppDetailsDrawer/AppDetailsDrawer.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/AppDetailsDrawer/AppDetailsDrawer.js index f06186beb1..c6ce74dc6c 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/AppDetailsDrawer/AppDetailsDrawer.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/AppDetailsDrawer/AppDetailsDrawer.js @@ -185,15 +185,16 @@ class AppDetailsDrawer extends React.Component { window.location.origin + config.serverConfig.invoker.uri + config.serverConfig.invoker.publisher + "/applications/" + id, data ).then(res => { - this.props.onUpdateApp("name", name); if (res.status === 200) { + const app = res.data.data; + this.props.onUpdateApp("name", app.name); notification["success"]({ message: 'Saved!', description: 'App name updated successfully!' }); this.setState({ loading: false, - name: name, + name: app.name, }); } @@ -268,6 +269,7 @@ class AppDetailsDrawer extends React.Component { data ).then(res => { if (res.status === 200) { + const app = res.data.data; this.props.onUpdateApp("categories", temporaryCategories); notification["success"]({ message: 'Saved!', @@ -275,7 +277,7 @@ class AppDetailsDrawer extends React.Component { }); this.setState({ loading: false, - categories: temporaryCategories, + categories: app.categories, isCategoriesEditEnabled: false }); @@ -334,13 +336,14 @@ class AppDetailsDrawer extends React.Component { data ).then(res => { if (res.status === 200) { + const app = res.data.data; notification["success"]({ message: 'Saved!', description: 'App tags updated successfully!' }); this.setState({ loading: false, - tags: temporaryTags, + tags: app.tags, isTagsEditEnabled: false }); } @@ -375,13 +378,14 @@ class AppDetailsDrawer extends React.Component { data ).then(res => { if (res.status === 200) { + const app = res.data.data; notification["success"]({ message: 'Saved!', description: 'App description updated successfully!' }); this.setState({ loading: false, - description: temporaryDescription, + description: app.description, isDescriptionEditEnabled: false }); }