Skip to content

Commit 4e63662

Browse files
committed
fix issues 593
A zoom meeting can only set one timezone when creating, and the only join url will show the waiting page, so I set the meeting timezone to the guest timezone.
1 parent a67c085 commit 4e63662

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/eventHandlers/InterviewEventHandler.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ async function sendInterviewScheduledNotifications (payload) {
128128
const data = await notificationsSchedulerService.getDataForInterview(interviewEntity)
129129
if (!data) { return }
130130

131-
const { meeting, zoomAccountApiKey } = await generateZoomMeetingLink(interviewEntity.startTimestamp, interviewEntity.duration)
131+
const { meeting, zoomAccountApiKey } = await generateZoomMeetingLink(interviewEntity.startTimestamp, interviewEntity.duration, interviewEntity.guestTimezone || interviewEntity.hostTimezone)
132132

133133
const updatedInterview = await interviewEntity.update({ zoomAccountApiKey, zoomMeetingId: meeting.id })
134134
await processUpdateInterview(updatedInterview.toJSON())

src/services/ZoomService.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,18 @@ async function generateZoomJWTBearerAccessToken (apiKey) {
6666
*
6767
* @param {Date} startTime the start time of the meeting
6868
* @param {Integer} duration the duration of the meeting
69+
* @param {String} timezone the timezone of the meeting
6970
* @returns Zoom API response
7071
*/
71-
async function createZoomMeeting (startTime, duration) {
72+
async function createZoomMeeting (startTime, duration, timezone) {
7273
const { accessToken, zoomAccountApiKey } = await generateZoomJWTBearerAccessToken()
7374

7475
// POST request details in Zoom API docs:
7576
// https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingcreate
7677
const res = await axios.post('https://api.zoom.us/v2/users/me/meetings', {
7778
type: 2,
7879
start_time: startTime.toISOString(),
80+
timezone,
7981
duration
8082
}, {
8183
headers: {
@@ -94,11 +96,12 @@ async function createZoomMeeting (startTime, duration) {
9496
*
9597
* @param {Date} startTime the start time of the meeting
9698
* @param {Integer} duration the duration of the meeting
99+
* @param {String} timezone the timezone of the meeting
97100
* @returns The meeting urls for the Zoom meeting
98101
*/
99-
async function generateZoomMeetingLink (startTime, duration) {
102+
async function generateZoomMeetingLink (startTime, duration, timezone) {
100103
try {
101-
const { meeting, zoomAccountApiKey } = await createZoomMeeting(startTime, duration)
104+
const { meeting, zoomAccountApiKey } = await createZoomMeeting(startTime, duration, timezone)
102105

103106
// learn more: https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingcreate#responses
104107
console.log(meeting.start_url, 'Zoom meeting link for host')

0 commit comments

Comments
 (0)