Type fixes

This commit is contained in:
zomars 2022-05-02 18:21:09 -06:00
parent aebb610403
commit 9ae8a48dcd

View file

@ -157,8 +157,8 @@ const ZoomVideoApiAdapter = (credential: Credential): VideoApiAdapter => {
}; };
return { return {
getAvailability: () => { getAvailability: async () => {
return auth return (await auth)
.getToken() .getToken()
.then( .then(
// TODO Possibly implement pagination for cases when there are more than 300 meetings already scheduled. // TODO Possibly implement pagination for cases when there are more than 300 meetings already scheduled.
@ -186,7 +186,7 @@ const ZoomVideoApiAdapter = (credential: Credential): VideoApiAdapter => {
}); });
}, },
createMeeting: async (event: CalendarEvent): Promise<VideoCallData> => { createMeeting: async (event: CalendarEvent): Promise<VideoCallData> => {
const accessToken = await auth.getToken(); const accessToken = await (await auth).getToken();
const result = await fetch("https://api.zoom.us/v2/users/me/meetings", { const result = await fetch("https://api.zoom.us/v2/users/me/meetings", {
method: "POST", method: "POST",
@ -205,7 +205,7 @@ const ZoomVideoApiAdapter = (credential: Credential): VideoApiAdapter => {
}); });
}, },
deleteMeeting: async (uid: string): Promise<void> => { deleteMeeting: async (uid: string): Promise<void> => {
const accessToken = await auth.getToken(); const accessToken = await (await auth).getToken();
await fetch("https://api.zoom.us/v2/meetings/" + uid, { await fetch("https://api.zoom.us/v2/meetings/" + uid, {
method: "DELETE", method: "DELETE",
@ -217,7 +217,7 @@ const ZoomVideoApiAdapter = (credential: Credential): VideoApiAdapter => {
return Promise.resolve(); return Promise.resolve();
}, },
updateMeeting: async (bookingRef: PartialReference, event: CalendarEvent): Promise<VideoCallData> => { updateMeeting: async (bookingRef: PartialReference, event: CalendarEvent): Promise<VideoCallData> => {
const accessToken = await auth.getToken(); const accessToken = await (await auth).getToken();
await fetch("https://api.zoom.us/v2/meetings/" + bookingRef.uid, { await fetch("https://api.zoom.us/v2/meetings/" + bookingRef.uid, {
method: "PATCH", method: "PATCH",