Skip to content

Commit 639940d

Browse files
authored
fix: couldn't get adapter issue for few apps (calcom#23813)
* fix: couldn't get adapter issue for few apps * Update videoClient.ts
1 parent d7397d4 commit 639940d

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

packages/lib/videoClient.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,15 @@ const getVideoAdapters = async (withCredentials: CredentialPayload[]): Promise<V
2828
const appName = cred.type.split("_").join(""); // Transform `zoom_video` to `zoomvideo`;
2929
log.silly("Getting video adapter for", safeStringify({ appName, cred: getPiiFreeCredential(cred) }));
3030

31-
const videoAdapterImport = VideoApiAdapterMap[appName as keyof typeof VideoApiAdapterMap];
31+
let videoAdapterImport = VideoApiAdapterMap[appName as keyof typeof VideoApiAdapterMap];
32+
33+
// fallback: transforms zoom_video to zoom
34+
if (!videoAdapterImport) {
35+
const appTypeVariant = cred.type.substring(0, cred.type.lastIndexOf("_"));
36+
log.silly(`Adapter not found for ${appName}, trying fallback ${appTypeVariant}`);
37+
38+
videoAdapterImport = VideoApiAdapterMap[appTypeVariant as keyof typeof VideoApiAdapterMap];
39+
}
3240

3341
if (!videoAdapterImport) {
3442
log.error(`Couldn't get adapter for ${appName}`);

0 commit comments

Comments
 (0)