From f221f9885d7da0a1cef6cad24b2d13aa29317c09 Mon Sep 17 00:00:00 2001 From: amit-kumaryadav Date: Wed, 23 Jun 2021 12:18:04 +0530 Subject: [PATCH 1/2] Changed the learner service direct call to kong --- src/protectedApi_v8/user/profile-details.ts | 2 +- src/utils/test.ts | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) delete mode 100644 src/utils/test.ts diff --git a/src/protectedApi_v8/user/profile-details.ts b/src/protectedApi_v8/user/profile-details.ts index 854c0d5..4298b77 100644 --- a/src/protectedApi_v8/user/profile-details.ts +++ b/src/protectedApi_v8/user/profile-details.ts @@ -10,7 +10,7 @@ import { extractUserIdFromRequest, extractUserToken } from '../../utils/requestE const API_END_POINTS = { createOSUserRegistry: (userId: string) => `${CONSTANTS.NETWORK_HUB_SERVICE_BACKEND}/v1/user/create/profile?userId=${userId}`, - createSb: `${CONSTANTS.LEARNER_SERVICE_API_BASE}/v3/user/create`, + createSb: `${CONSTANTS.KONG_API_BASE}/user/v3/create`, createUserRegistry: `${CONSTANTS.USER_PROFILE_API_BASE}/public/v8/profileDetails/createUserRegistry`, getMasterLanguages: `${CONSTANTS.USER_PROFILE_API_BASE}/public/v8/profileDetails/getMasterLanguages`, getMasterNationalities: `${CONSTANTS.USER_PROFILE_API_BASE}/public/v8/profileDetails/getMasterNationalities`, diff --git a/src/utils/test.ts b/src/utils/test.ts deleted file mode 100644 index b710209..0000000 --- a/src/utils/test.ts +++ /dev/null @@ -1,4 +0,0 @@ -export const test = { - key: 'a', - key1: 'b', -} From 539fc51d2e8334953a9afdfa080ecce99c6feae2 Mon Sep 17 00:00:00 2001 From: amit-kumaryadav Date: Wed, 23 Jun 2021 13:02:24 +0530 Subject: [PATCH 2/2] Autorization issue --- src/protectedApi_v8/user/profile-details.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/protectedApi_v8/user/profile-details.ts b/src/protectedApi_v8/user/profile-details.ts index 4298b77..84da944 100644 --- a/src/protectedApi_v8/user/profile-details.ts +++ b/src/protectedApi_v8/user/profile-details.ts @@ -232,6 +232,11 @@ profileDeatailsApi.post('/createUser', async (req, res) => { const response = await axios({ ...axiosRequestConfig, data: { request: sbUserProfile }, + headers: { + Authorization: CONSTANTS.SB_API_KEY, + // tslint:disable-next-line: all + 'x-authenticated-user-token': extractUserToken(req), + }, method: 'POST', url: API_END_POINTS.createSb, }) @@ -363,6 +368,11 @@ profileDeatailsApi.post('/createUserV2WithRegistry', async (req, res) => { const response = await axios({ ...axiosRequestConfig, data: { request: sbUserProfile }, + headers: { + Authorization: CONSTANTS.SB_API_KEY, + // tslint:disable-next-line: all + 'x-authenticated-user-token': extractUserToken(req), + }, method: 'POST', url: API_END_POINTS.createSb, }) @@ -446,6 +456,11 @@ profileDeatailsApi.post('/createUserV2WithoutRegistry', async (req, res) => { const response = await axios({ ...axiosRequestConfig, data: { request: sbUserProfile }, + headers: { + Authorization: CONSTANTS.SB_API_KEY, + // tslint:disable-next-line: all + 'x-authenticated-user-token': extractUserToken(req), + }, method: 'POST', url: API_END_POINTS.createSb, })