From 04db6648364f6952673917466383322cbae11314 Mon Sep 17 00:00:00 2001 From: veshu Date: Thu, 12 Nov 2020 08:50:36 +0545 Subject: [PATCH] fix mock API behind gateway --- local/mock-server/data.json | 20 +++++++++---------- local/mock-server/index.js | 6 ------ .../PositionCandidates/index.jsx | 6 +++++- src/services/teams.js | 4 +--- 4 files changed, 16 insertions(+), 20 deletions(-) diff --git a/local/mock-server/data.json b/local/mock-server/data.json index 6c46259c..0b707fac 100644 --- a/local/mock-server/data.json +++ b/local/mock-server/data.json @@ -1568,7 +1568,7 @@ "handle": "Tony", "firstName": "Tony", "lastName": "J", - "resumeLink": "http://localhost:8502/Resume-PDF-Example.pdf", + "resumeLink": "/Resume-PDF-Example.pdf", "status": "open", "skills": [ { @@ -1624,7 +1624,7 @@ "handle": "TCConCopilotMgr", "firstName": "Liza", "lastName": "Qun", - "resumeLink": "http://localhost:8502/Resume-PDF-Example.pdf", + "resumeLink": "/Resume-PDF-Example.pdf", "status": "open", "skills": [ { @@ -1676,7 +1676,7 @@ "handle": "ariel", "firstName": "Cat", "lastName": "Unknown", - "resumeLink": "http://localhost:8502/Resume-PDF-Example.pdf", + "resumeLink": "/Resume-PDF-Example.pdf", "status": "open", "skills": [ { @@ -1724,7 +1724,7 @@ "handle": "TCConManager", "firstName": "John", "lastName": "Busby", - "resumeLink": "http://localhost:8502/Resume-PDF-Example.pdf", + "resumeLink": "/Resume-PDF-Example.pdf", "status": "open", "skills": [ { @@ -1776,7 +1776,7 @@ "handle": "UnknownDog", "firstName": "Dog", "lastName": "Unknown", - "resumeLink": "http://localhost:8502/Resume-PDF-Example.pdf", + "resumeLink": "/Resume-PDF-Example.pdf", "status": "open", "skills": [ { @@ -1828,7 +1828,7 @@ "handle": "pshah_manager", "firstName": "Richard", "lastName": "Gere", - "resumeLink": "http://localhost:8502/Resume-PDF-Example.pdf", + "resumeLink": "/Resume-PDF-Example.pdf", "status": "open", "skills": [ { @@ -1880,7 +1880,7 @@ "handle": "TCConAccountMgr", "firstName": "Brad", "lastName": "Pitt", - "resumeLink": "http://localhost:8502/Resume-PDF-Example.pdf", + "resumeLink": "/Resume-PDF-Example.pdf", "status": "open", "skills": [ { @@ -1932,7 +1932,7 @@ "handle": "sachin-kumar", "firstName": "Kumar", "lastName": "Sachin", - "resumeLink": "http://localhost:8502/Resume-PDF-Example.pdf", + "resumeLink": "/Resume-PDF-Example.pdf", "status": "shortlist", "skills": [ { @@ -1984,7 +1984,7 @@ "handle": "pshah_copilot", "firstName": "Max", "lastName": "Wild", - "resumeLink": "http://localhost:8502/Resume-PDF-Example.pdf", + "resumeLink": "/Resume-PDF-Example.pdf", "status": "shortlist", "skills": [ { @@ -2036,7 +2036,7 @@ "handle": "maxceem14", "firstName": "Maksym", "lastName": "Dindon", - "resumeLink": "http://localhost:8502/Resume-PDF-Example.pdf", + "resumeLink": "/Resume-PDF-Example.pdf", "status": "rejected", "skills": [ { diff --git a/local/mock-server/index.js b/local/mock-server/index.js index 12f12025..257d3fa6 100644 --- a/local/mock-server/index.js +++ b/local/mock-server/index.js @@ -8,12 +8,6 @@ const middlewares = jsonServer.defaults(); const PORT = 8502; server.use(middlewares); -server.use( - jsonServer.rewriter({ - // match URL - "/taas-teams/:teamId/jobs/:jobId": "/jobs/:jobId?teamId=:teamId", - }) -); // serve Resume PDF Example for download server.get("/Resume-PDF-Example.pdf", (req, res) => { diff --git a/src/routes/PositionDetails/PositionCandidates/index.jsx b/src/routes/PositionDetails/PositionCandidates/index.jsx index 4943f44d..5ded3b76 100644 --- a/src/routes/PositionDetails/PositionCandidates/index.jsx +++ b/src/routes/PositionDetails/PositionCandidates/index.jsx @@ -23,6 +23,7 @@ import Button from "components/Button"; import Pagination from "components/Pagination"; import IconResume from "../../../assets/images/icon-resume.svg"; import { skillShape } from "components/SkillsList"; +import { TC_TEAMS_SERVICE_URL } from "../../../../config"; /** * Generates a function to sort candidates @@ -129,7 +130,10 @@ const PositionCandidates = ({ limit={7} /> {candidate.resumeLink && ( - + Download Resume diff --git a/src/services/teams.js b/src/services/teams.js index f3ba3b01..abc5f34c 100644 --- a/src/services/teams.js +++ b/src/services/teams.js @@ -35,7 +35,5 @@ export const getTeamById = (teamId) => { * @returns {Promise} job object */ export const getPositionDetails = (teamId, positionId) => { - return axios.get( - `${config.TC_TEAMS_SERVICE_URL}/taas-teams/${teamId}/jobs/${positionId}` - ); + return axios.get(`${config.TC_TEAMS_SERVICE_URL}/jobs/${positionId}`); };