From 9cde7387352d75fd1b7422808811f26e17cbd720 Mon Sep 17 00:00:00 2001
From: ManosAngelidis <angelidis@fortiss.org>
Date: Tue, 27 Apr 2021 10:23:28 +0200
Subject: [PATCH] [NRRPLT-8250] Fixed the endpoints.json to contain the url of
 GDPR

---
 src/mocks/handlers.js                  |  4 ++--
 src/services/proxy/data/endpoints.json | 10 ++++++----
 src/services/proxy/nrp-user-service.js |  2 +-
 3 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/src/mocks/handlers.js b/src/mocks/handlers.js
index fefc3d9..f858cad 100644
--- a/src/mocks/handlers.js
+++ b/src/mocks/handlers.js
@@ -49,14 +49,14 @@ export const handlers = [
   rest.get(`${config.api.proxy.url}${endpoints.proxy.identity.me.groups.url}`, (req, res, ctx) => {
     return res(ctx.json(MockUserGroups));
   }),
-  rest.get(`${config.api.proxy.url}${endpoints.proxy.identity.url}${endpoints.proxy.identity.gdpr}`,
+  rest.get(`${config.api.proxy.url}${endpoints.proxy.identity.url}${endpoints.proxy.identity.gdpr.url}`,
     (req, res, ctx) => {
       return res(ctx.json(MockGDPR));
     }),
   rest.get(`${config.api.proxy.url}${endpoints.proxy.identity.url}/:userID`, (req, res, ctx) => {
     return res(ctx.json(MockUsers[1]));
   }),
-  rest.post(`${config.api.proxy.url}${endpoints.proxy.identity.url}${endpoints.proxy.identity.gdpr}`,
+  rest.post(`${config.api.proxy.url}${endpoints.proxy.identity.url}${endpoints.proxy.identity.gdpr.url}`,
     (req, res, ctx) => {
       return res(ctx.json({"status":"success"}));
     })
diff --git a/src/services/proxy/data/endpoints.json b/src/services/proxy/data/endpoints.json
index d1ced87..aa5c143 100644
--- a/src/services/proxy/data/endpoints.json
+++ b/src/services/proxy/data/endpoints.json
@@ -17,7 +17,9 @@
                     "url": "/identity/me/groups"
                 }
             },
-            "gdpr": "/gdpr"
+            "gdpr": {
+                "url": "/gdpr"
+            }
         },
         "server": {
             "url": "/server"
@@ -30,11 +32,11 @@
             "experiments": {
                 "url": "/storage/experiments"
             },
-            "importExperiment":{
+            "importExperiment": {
                 "url": "/storage/importExperiment"
             },
-            "scanStorage":{
-                "url":"/storage/scanStorage"
+            "scanStorage": {
+                "url": "/storage/scanStorage"
             }
         }
     }
diff --git a/src/services/proxy/nrp-user-service.js b/src/services/proxy/nrp-user-service.js
index 5bd1c50..9801ef0 100644
--- a/src/services/proxy/nrp-user-service.js
+++ b/src/services/proxy/nrp-user-service.js
@@ -14,7 +14,7 @@ const PROXY_URL = config.api.proxy.url;
 const IDENTITY_BASE_URL = `${PROXY_URL}${endpoints.proxy.identity.url}`;
 const IDENTITY_ME_URL = `${PROXY_URL}${endpoints.proxy.identity.me.url}`;
 const IDENTITY_ME_GROUPS_URL = `${PROXY_URL}${endpoints.proxy.identity.me.groups.url}`;
-const GDPR_URL = `${IDENTITY_BASE_URL}${endpoints.proxy.identity.gdpr}`;
+const GDPR_URL = `${IDENTITY_BASE_URL}${endpoints.proxy.identity.gdpr.url}`;
 /**
  * Service managing all data related to NRP users.
  */
-- 
GitLab