Fix: Sylaps app shown uninstalled after installation (#8256)

This commit is contained in:
Hariom Balhara 2023-04-14 13:34:41 +05:30 committed by GitHub
parent 6639588c2d
commit fe155b0b97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -3,6 +3,7 @@ import type { NextApiRequest, NextApiResponse } from "next";
import prisma from "@calcom/prisma";
import getInstalledAppPath from "../../_utils/getInstalledAppPath";
import config from "../config.json";
/**
* This is an example endpoint for an app, these will run under `/api/integrations/[...args]`
@ -13,7 +14,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
if (!req.session?.user?.id) {
return res.status(401).json({ message: "You must be logged in to do this" });
}
const appType = "sylaps_video";
const appType = config.type;
try {
const alreadyInstalled = await prisma.credential.findFirst({
where: {
@ -29,7 +30,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
type: appType,
key: {},
userId: req.session.user.id,
appId: "sylaps",
appId: config.slug,
},
});
if (!installation) {
@ -41,5 +42,5 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
}
return res.status(500);
}
return res.status(200).json({ url: getInstalledAppPath({ variant: "conferencing", slug: "sylaps" }) });
return res.status(200).json({ url: getInstalledAppPath({ variant: "conferencing", slug: config.slug }) });
}

View File

@ -232,7 +232,7 @@ export default async function main() {
});
}
await createApp("jitsi", "jitsivideo", ["video"], "jitsi_video");
await createApp("sylaps", "sylapsvideo", ["video"], "sylaps_video");
await createApp("sylapsvideo", "sylapsvideo", ["video"], "sylaps_video");
// Other apps
if (process.env.HUBSPOT_CLIENT_ID && process.env.HUBSPOT_CLIENT_SECRET) {
await createApp("hubspot", "hubspot", ["other"], "hubspot_other_calendar", {