From 7540b2271a08e747e7ef24bd6198cea7db269504 Mon Sep 17 00:00:00 2001 From: Georgi 7DIGIT Date: Wed, 18 Sep 2024 16:42:56 +0300 Subject: [PATCH] Add: join consultation request in the JoinConsultation backdrop --- src/backdrops/JoinConsultation/JoinConsultation.jsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/backdrops/JoinConsultation/JoinConsultation.jsx b/src/backdrops/JoinConsultation/JoinConsultation.jsx index 41dbd4c8..c47f9273 100644 --- a/src/backdrops/JoinConsultation/JoinConsultation.jsx +++ b/src/backdrops/JoinConsultation/JoinConsultation.jsx @@ -4,7 +4,11 @@ import { toast } from "react-toastify"; import { useNavigate } from "react-router-dom"; import { Backdrop, ButtonSelector } from "@USupport-components-library/src"; -import { messageSvc, videoSvc } from "@USupport-components-library/services"; +import { + messageSvc, + videoSvc, + providerSvc, +} from "@USupport-components-library/services"; import "./join-consultation.scss"; @@ -35,10 +39,16 @@ export const JoinConsultation = ({ isOpen, onClose, consultation }) => { consultation.consultationId ); + const joinConsultationPromise = providerSvc.joinConsultation({ + consultationId: consultation.consultationId, + userType: "client", + }); + try { const result = await Promise.all([ systemMessagePromise, getConsultationTokenPromise, + joinConsultationPromise, ]); const token = result[1].data.token;