fix: huddle01 is not generating meeting link (#17417)
* fix: huddle01 not generating link * update
This commit is contained in:
1 parent
ced7f282a5
commit
f649f8b78d
3 files changed
+10
-20
No files matched your search
@@ -4,13 +4,18 @@ import type { CredentialPayload } from "@calcom/types/Credential";
|
||||
import type { PartialReference } from "@calcom/types/EventManager";
|
||||
import type { VideoApiAdapter } from "@calcom/types/VideoApiAdapter";
|
||||
|
||||
import { getHuddle01APIKey, getHuddle01Credential } from "../utils/storage";
|
||||
import { getHuddle01Credential } from "../utils/storage";
|
||||
|
||||
const API_END_POINT = "https://platform-api.huddle01.workers.dev/api/v2/calendar";
|
||||
|
||||
const fetchHuddleAPI = async (userId: number) => {
|
||||
const { identityToken } = await getHuddle01Credential(userId);
|
||||
const { apiKey } = await getHuddle01APIKey();
|
||||
const apiKey = process.env.HUDDLE01_API_TOKEN;
|
||||
|
||||
if (!apiKey) {
|
||||
log.error("[Huddle01 Error] -> app key not found");
|
||||
throw new Error("Huddle01 app key not found");
|
||||
}
|
||||
|
||||
const headers = {
|
||||
"x-api-key": apiKey,
|
||||
|
||||
@@ -49,21 +49,3 @@ export async function getHuddle01Credential(userId: number) {
|
||||
|
||||
return huddle01AppKeySchema.parse(credential?.key);
|
||||
}
|
||||
|
||||
const huddle01APIKeySchema = z.object({
|
||||
apiKey: z.string(),
|
||||
});
|
||||
|
||||
export async function getHuddle01APIKey() {
|
||||
const appCreds = await prisma.app.findFirst({
|
||||
where: {
|
||||
slug: "huddle01",
|
||||
},
|
||||
});
|
||||
|
||||
if (!appCreds) {
|
||||
throw new Error("Huddle01 app credential not found");
|
||||
}
|
||||
|
||||
return huddle01APIKeySchema.parse(appCreds?.keys);
|
||||
}
|
||||
Reference in new issue
Block a user