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

Commit 8961b3c

Browse files
authored
Merge pull request #584 from yoution/issue-583
fix: issue #583
2 parents 8c5a2a4 + 16d3182 commit 8961b3c

File tree

2 files changed

+13
-20
lines changed

2 files changed

+13
-20
lines changed

src/routes/CancelInterviewPage/index.jsx

+13-9
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ import React, { useEffect, useState } from "react";
77
import { toastr } from "react-redux-toastr";
88
import Page from "components/Page";
99
import moment from "moment";
10+
import axios from "axios";
1011
import PageHeader from "components/PageHeader";
1112
import Button from "components/Button";
1213
import Input from "components/Input";
1314
import LoadingIndicator from "components/LoadingIndicator";
1415
import { getAuthUserProfile } from "@topcoder/micro-frontends-navbar-app";
15-
import { getJobCandidateById } from "services/teams";
1616
import { getJobById } from "services/jobs";
1717
import { getInterview, cancelInterview } from "services/interviews";
1818
import { INTERVIEW_STATUS } from "constants";
@@ -62,13 +62,17 @@ const CancelInterviewPage = ({ interviewId }) => {
6262
) {
6363
setInterview(data);
6464

65-
return getJobCandidateById(
66-
data.jobCandidateId
67-
).then(({ data: { jobId } }) =>
68-
getJobById(jobId).then(({ data: { title } }) =>
69-
setJobTitle(title)
70-
)
71-
);
65+
return axios
66+
.get(`https://schedule.nylas.com/${data.nylasPageSlug}`)
67+
.then(({ data: nylasHtml }) => {
68+
// extract json object from html file
69+
const nylasconfig = JSON.parse(
70+
nylasHtml.match(
71+
/window.nylasWindowContext.page = (.*);<\/script>/
72+
)[1]
73+
);
74+
setJobTitle(nylasconfig.name);
75+
});
7276
} else {
7377
setErrorMessage(
7478
`This interview has status ${data.status} and cannot be cancelled.`
@@ -91,7 +95,7 @@ const CancelInterviewPage = ({ interviewId }) => {
9195
<PageHeader title="Cancel Interview" />
9296
<div>
9397
<div styleName="top-bar">
94-
<h1>Job Interview for "{jobTitle}"</h1>
98+
<h1>{jobTitle}</h1>
9599
</div>
96100
<div styleName="shadowed-content">
97101
<div styleName="slot-cancelview">

src/services/teams.js

-11
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,6 @@ export const getPositionDetails = (teamId, positionId) => {
7070
return axios.get(`${config.API.V5}/taas-teams/${teamId}/jobs/${positionId}`);
7171
};
7272

73-
/**
74-
* Get Job Candidate.
75-
*
76-
* @param {string} candidateId position candidate id
77-
*
78-
* @returns {Promise<object{}>} position candidate
79-
*/
80-
export const getJobCandidateById = (candidateId) => {
81-
return axios.get(`${config.API.V5}/jobCandidates/${candidateId}`);
82-
};
83-
8473
/**
8574
* Patch Position Candidate
8675
*

0 commit comments

Comments
 (0)