Skip to content

Commit

Permalink
fix(meetings): Wait for twilio client
Browse files Browse the repository at this point in the history
  • Loading branch information
HagerDakroury committed Jul 16, 2021
1 parent c16a0e5 commit ffa6db5
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions meetings/src/routes/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,13 @@ router.post(`${baseUrl}/start/:id`, async (req: Request, res: Response) => {

//create a room in twilio and return an access token
const roomName = meeting.title + "-" + meeting.course;
client.video.rooms
.create({
type: "group",
uniqueName: roomName,
})
.then(async (room: { sid: any }) => {
meeting.sid = room.sid;
await meeting.save();
});
const room: { sid: any } = await client.video.rooms.create({
type: "group",
uniqueName: roomName,
});

meeting.sid = room.sid;
await meeting.save();

const token = createTwilioToken(user, roomName);

Expand Down

0 comments on commit ffa6db5

Please sign in to comment.