Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 0159912

Browse files
Merge pull request #3 from topcoder-platform/final-fixes
fix mock API behind gateway
2 parents 35c475d + 04db664 commit 0159912

File tree

4 files changed

+16
-20
lines changed

4 files changed

+16
-20
lines changed

local/mock-server/data.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1568,7 +1568,7 @@
15681568
"handle": "Tony",
15691569
"firstName": "Tony",
15701570
"lastName": "J",
1571-
"resumeLink": "http://localhost:8502/Resume-PDF-Example.pdf",
1571+
"resumeLink": "/Resume-PDF-Example.pdf",
15721572
"status": "open",
15731573
"skills": [
15741574
{
@@ -1624,7 +1624,7 @@
16241624
"handle": "TCConCopilotMgr",
16251625
"firstName": "Liza",
16261626
"lastName": "Qun",
1627-
"resumeLink": "http://localhost:8502/Resume-PDF-Example.pdf",
1627+
"resumeLink": "/Resume-PDF-Example.pdf",
16281628
"status": "open",
16291629
"skills": [
16301630
{
@@ -1676,7 +1676,7 @@
16761676
"handle": "ariel",
16771677
"firstName": "Cat",
16781678
"lastName": "Unknown",
1679-
"resumeLink": "http://localhost:8502/Resume-PDF-Example.pdf",
1679+
"resumeLink": "/Resume-PDF-Example.pdf",
16801680
"status": "open",
16811681
"skills": [
16821682
{
@@ -1724,7 +1724,7 @@
17241724
"handle": "TCConManager",
17251725
"firstName": "John",
17261726
"lastName": "Busby",
1727-
"resumeLink": "http://localhost:8502/Resume-PDF-Example.pdf",
1727+
"resumeLink": "/Resume-PDF-Example.pdf",
17281728
"status": "open",
17291729
"skills": [
17301730
{
@@ -1776,7 +1776,7 @@
17761776
"handle": "UnknownDog",
17771777
"firstName": "Dog",
17781778
"lastName": "Unknown",
1779-
"resumeLink": "http://localhost:8502/Resume-PDF-Example.pdf",
1779+
"resumeLink": "/Resume-PDF-Example.pdf",
17801780
"status": "open",
17811781
"skills": [
17821782
{
@@ -1828,7 +1828,7 @@
18281828
"handle": "pshah_manager",
18291829
"firstName": "Richard",
18301830
"lastName": "Gere",
1831-
"resumeLink": "http://localhost:8502/Resume-PDF-Example.pdf",
1831+
"resumeLink": "/Resume-PDF-Example.pdf",
18321832
"status": "open",
18331833
"skills": [
18341834
{
@@ -1880,7 +1880,7 @@
18801880
"handle": "TCConAccountMgr",
18811881
"firstName": "Brad",
18821882
"lastName": "Pitt",
1883-
"resumeLink": "http://localhost:8502/Resume-PDF-Example.pdf",
1883+
"resumeLink": "/Resume-PDF-Example.pdf",
18841884
"status": "open",
18851885
"skills": [
18861886
{
@@ -1932,7 +1932,7 @@
19321932
"handle": "sachin-kumar",
19331933
"firstName": "Kumar",
19341934
"lastName": "Sachin",
1935-
"resumeLink": "http://localhost:8502/Resume-PDF-Example.pdf",
1935+
"resumeLink": "/Resume-PDF-Example.pdf",
19361936
"status": "shortlist",
19371937
"skills": [
19381938
{
@@ -1984,7 +1984,7 @@
19841984
"handle": "pshah_copilot",
19851985
"firstName": "Max",
19861986
"lastName": "Wild",
1987-
"resumeLink": "http://localhost:8502/Resume-PDF-Example.pdf",
1987+
"resumeLink": "/Resume-PDF-Example.pdf",
19881988
"status": "shortlist",
19891989
"skills": [
19901990
{
@@ -2036,7 +2036,7 @@
20362036
"handle": "maxceem14",
20372037
"firstName": "Maksym",
20382038
"lastName": "Dindon",
2039-
"resumeLink": "http://localhost:8502/Resume-PDF-Example.pdf",
2039+
"resumeLink": "/Resume-PDF-Example.pdf",
20402040
"status": "rejected",
20412041
"skills": [
20422042
{

local/mock-server/index.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@ const middlewares = jsonServer.defaults();
88
const PORT = 8502;
99

1010
server.use(middlewares);
11-
server.use(
12-
jsonServer.rewriter({
13-
// match URL
14-
"/taas-teams/:teamId/jobs/:jobId": "/jobs/:jobId?teamId=:teamId",
15-
})
16-
);
1711

1812
// serve Resume PDF Example for download
1913
server.get("/Resume-PDF-Example.pdf", (req, res) => {

src/routes/PositionDetails/PositionCandidates/index.jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import Button from "components/Button";
2323
import Pagination from "components/Pagination";
2424
import IconResume from "../../../assets/images/icon-resume.svg";
2525
import { skillShape } from "components/SkillsList";
26+
import { TC_TEAMS_SERVICE_URL } from "../../../../config";
2627

2728
/**
2829
* Generates a function to sort candidates
@@ -129,7 +130,10 @@ const PositionCandidates = ({
129130
limit={7}
130131
/>
131132
{candidate.resumeLink && (
132-
<a href={candidate.resumeLink} styleName="resume-link">
133+
<a
134+
href={`${TC_TEAMS_SERVICE_URL}${candidate.resumeLink}`}
135+
styleName="resume-link"
136+
>
133137
<IconResume />
134138
Download Resume
135139
</a>

src/services/teams.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,5 @@ export const getTeamById = (teamId) => {
3535
* @returns {Promise<object{}>} job object
3636
*/
3737
export const getPositionDetails = (teamId, positionId) => {
38-
return axios.get(
39-
`${config.TC_TEAMS_SERVICE_URL}/taas-teams/${teamId}/jobs/${positionId}`
40-
);
38+
return axios.get(`${config.TC_TEAMS_SERVICE_URL}/jobs/${positionId}`);
4139
};

0 commit comments

Comments
 (0)