From b420c9da3ef56718964984a85fe7fa3a57f3e409 Mon Sep 17 00:00:00 2001 From: Hager Eldakroury Date: Fri, 16 Jul 2021 18:16:18 +0200 Subject: [PATCH] fix(meetings): H andle twilio end errors --- meetings/src/routes/end.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/meetings/src/routes/end.ts b/meetings/src/routes/end.ts index d37b5e6..8b71689 100644 --- a/meetings/src/routes/end.ts +++ b/meetings/src/routes/end.ts @@ -51,12 +51,10 @@ router.post(`${baseUrl}/end/:id`, async (req: Request, res: Response) => { await meeting.save(); //end the meeting twilio - client.video + const room: { uniquename: any } = client.video .rooms(meeting.sid) - .update({ status: "completed" }) - .then((room: { uniquename: any }) => { - return res.status(201).send("Meeting ended sccessfully"); - }); + .update({ status: "completed" }); + res.status(201).send("Meeting ended sccessfully"); } catch (error) { return res.status(400).send(error.message); }