@@ -7,12 +7,12 @@ import React, { useEffect, useState } from "react";
7
7
import { toastr } from "react-redux-toastr" ;
8
8
import Page from "components/Page" ;
9
9
import moment from "moment" ;
10
+ import axios from "axios" ;
10
11
import PageHeader from "components/PageHeader" ;
11
12
import Button from "components/Button" ;
12
13
import Input from "components/Input" ;
13
14
import LoadingIndicator from "components/LoadingIndicator" ;
14
15
import { getAuthUserProfile } from "@topcoder/micro-frontends-navbar-app" ;
15
- import { getJobCandidateById } from "services/teams" ;
16
16
import { getJobById } from "services/jobs" ;
17
17
import { getInterview , cancelInterview } from "services/interviews" ;
18
18
import { INTERVIEW_STATUS } from "constants" ;
@@ -62,13 +62,17 @@ const CancelInterviewPage = ({ interviewId }) => {
62
62
) {
63
63
setInterview ( data ) ;
64
64
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
+ / w i n d o w .n y l a s W i n d o w C o n t e x t .p a g e = ( .* ) ; < \/ s c r i p t > /
72
+ ) [ 1 ]
73
+ ) ;
74
+ setJobTitle ( nylasconfig . name ) ;
75
+ } ) ;
72
76
} else {
73
77
setErrorMessage (
74
78
`This interview has status ${ data . status } and cannot be cancelled.`
@@ -91,7 +95,7 @@ const CancelInterviewPage = ({ interviewId }) => {
91
95
< PageHeader title = "Cancel Interview" />
92
96
< div >
93
97
< div styleName = "top-bar" >
94
- < h1 > Job Interview for " { jobTitle } " </ h1 >
98
+ < h1 > { jobTitle } </ h1 >
95
99
</ div >
96
100
< div styleName = "shadowed-content" >
97
101
< div styleName = "slot-cancelview" >
0 commit comments