summaryrefslogtreecommitdiffstats
path: root/ui-react/src/api
diff options
context:
space:
mode:
authorSébastien Determe <sebastien.determe@intl.att.com>2019-07-29 11:17:58 +0000
committerGerrit Code Review <gerrit@onap.org>2019-07-29 11:17:58 +0000
commit4453cc6abdd95f5ee30c205731237dd7f2d6ae52 (patch)
treef991d5d57c6a2201b794fb76a0845fbb322363c9 /ui-react/src/api
parent2eb723772eb99e67d621165d38f289a260488b05 (diff)
parente52d5727650590b9adaa43f5830c40913cebf348 (diff)
Merge "Rework user info window"
Diffstat (limited to 'ui-react/src/api')
-rw-r--r--ui-react/src/api/UserService.js23
1 files changed, 22 insertions, 1 deletions
diff --git a/ui-react/src/api/UserService.js b/ui-react/src/api/UserService.js
index 22168d41b..be21e692a 100644
--- a/ui-react/src/api/UserService.js
+++ b/ui-react/src/api/UserService.js
@@ -47,5 +47,26 @@ export default class UserService {
return UserService.notLoggedUserName;
});
}
-}
+ static getUserInfo() {
+ return fetch('/restservices/clds/v1/clds/cldsInfo', {
+ method: 'GET',
+ credentials: 'same-origin',
+ })
+ .then(function (response) {
+ console.debug("getUserInfo response received, status code:", response.status);
+ if (response.ok) {
+ return response.json();
+ }
+ })
+ .then(function (data) {
+ console.info ("User info received:",data)
+ return data;
+ })
+ .catch(function(error) {
+ console.warn("getUserInfo error received, user set to: ",UserService.notLoggedUserName);
+ console.error("getUserInfo error:",error);
+ return;
+ });
+ }
+}