Fix: Sylaps app shown uninstalled after installation (#8256)
This commit is contained in:
parent
6639588c2d
commit
fe155b0b97
|
@ -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 }) });
|
||||
}
|
||||
|
|
|
@ -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", {
|
||||
|
|
Loading…
Reference in New Issue
Block a user