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

This commit is contained in:
Hariom Balhara
2023-04-14 10:04:41 +02:00
committed by GitHub
parent 6639588c2d
commit fe155b0b97
2 changed files with 5 additions and 4 deletions
+4 -3
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 }) });
}
+1 -1
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", {