fix: invalid type of enable_transcription_storage (#15049)
* fix: invalid type of enable_transcription_storage * fix: type err
This commit is contained in:
@@ -6,7 +6,7 @@ import { Toaster } from "react-hot-toast";
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { showToast } from "@calcom/ui";
|
||||
|
||||
export const CalAiTransctibe = () => {
|
||||
export const CalAiTranscribe = () => {
|
||||
const daily = useDaily();
|
||||
const { t } = useLocale();
|
||||
|
||||
|
||||
@@ -60,6 +60,19 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
|
||||
};
|
||||
}
|
||||
|
||||
const hasTeamPlan = booking.user?.id
|
||||
? await prisma.membership.findFirst({
|
||||
where: {
|
||||
userId: booking.user.id,
|
||||
team: {
|
||||
slug: {
|
||||
not: null,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
: false;
|
||||
|
||||
const profile = booking.user
|
||||
? (
|
||||
await UserRepository.enrichUserWithItsProfile({
|
||||
@@ -114,6 +127,7 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
|
||||
}
|
||||
: bookingObj.user,
|
||||
},
|
||||
hasTeamPlan: !!hasTeamPlan,
|
||||
trpcState: ssr.dehydrate(),
|
||||
},
|
||||
};
|
||||
|
||||
@@ -14,13 +14,13 @@ import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { markdownToSafeHTML } from "@calcom/lib/markdownToSafeHTML";
|
||||
import { Icon } from "@calcom/ui";
|
||||
|
||||
import { CalAiTransctibe } from "~/videos/ai/ai-transcribe";
|
||||
import { CalAiTranscribe } from "~/videos/ai/ai-transcribe";
|
||||
|
||||
import { type PageProps } from "./videos-single-view.getServerSideProps";
|
||||
|
||||
export default function JoinCall(props: PageProps) {
|
||||
const { t } = useLocale();
|
||||
const { meetingUrl, meetingPassword, booking } = props;
|
||||
const { meetingUrl, meetingPassword, booking, hasTeamPlan } = props;
|
||||
const [daily, setDaily] = useState<DailyCall | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -47,14 +47,16 @@ export default function JoinCall(props: PageProps) {
|
||||
},
|
||||
url: meetingUrl,
|
||||
...(typeof meetingPassword === "string" && { token: meetingPassword }),
|
||||
customTrayButtons: {
|
||||
transcription: {
|
||||
label: "Cal.ai",
|
||||
tooltip: "Toggle real time transcription powered by AI",
|
||||
iconPath: `${WEBAPP_URL}/sparkles.svg`,
|
||||
iconPathDarkMode: `${WEBAPP_URL}/sparkles.svg`,
|
||||
...(hasTeamPlan && {
|
||||
customTrayButtons: {
|
||||
transcription: {
|
||||
label: "Cal.ai",
|
||||
tooltip: "Toggle real time transcription powered by AI",
|
||||
iconPath: `${WEBAPP_URL}/sparkles.svg`,
|
||||
iconPathDarkMode: `${WEBAPP_URL}/sparkles.svg`,
|
||||
},
|
||||
},
|
||||
},
|
||||
}),
|
||||
});
|
||||
|
||||
setDaily(callFrame);
|
||||
@@ -86,7 +88,7 @@ export default function JoinCall(props: PageProps) {
|
||||
</Head>
|
||||
<DailyProvider callObject={daily}>
|
||||
<div className="mx-auto" style={{ zIndex: 2, position: "absolute", bottom: 60, width: "100%" }}>
|
||||
<CalAiTransctibe />
|
||||
<CalAiTranscribe />
|
||||
</div>
|
||||
<div style={{ zIndex: 2, position: "relative" }}>
|
||||
{booking?.user?.organization?.calVideoLogo ? (
|
||||
|
||||
@@ -30,7 +30,7 @@ const dailyReturnTypeSchema = z.object({
|
||||
enable_chat: z.boolean(),
|
||||
enable_knocking: z.boolean(),
|
||||
enable_prejoin_ui: z.boolean(),
|
||||
enable_transcription_storage: z.boolean(),
|
||||
enable_transcription_storage: z.boolean().default(false),
|
||||
}),
|
||||
});
|
||||
|
||||
@@ -179,9 +179,11 @@ const DailyVideoApiAdapter = (): VideoApiAdapter => {
|
||||
exp: exp,
|
||||
enable_recording: scalePlan === "true" && !!hasTeamPlan === true ? "cloud" : undefined,
|
||||
enable_transcription_storage: !!hasTeamPlan,
|
||||
permissions: {
|
||||
canAdmin: ["transcription"],
|
||||
},
|
||||
...(!!hasTeamPlan && {
|
||||
permissions: {
|
||||
canAdmin: ["transcription"],
|
||||
},
|
||||
}),
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user