* [CAL-1517] fix all Typescript warnings * solve conflicts * Update stripeCheckoutSession.handler.ts Parse is a guard, so even though the variable is unused the parse itself is needed. * Update ToolbarPlugin.tsx Don't change dependency tree --------- Co-authored-by: gitstart-calcom <gitstart@users.noreply.github.com> Co-authored-by: Peer Richelsen <peeroke@gmail.com> Co-authored-by: Alex van Andel <me@alexvanandel.com>
32 lines
581 B
TypeScript
32 lines
581 B
TypeScript
import { prisma } from "@calcom/prisma";
|
|
import type { TrpcSessionUser } from "@calcom/trpc/server/trpc";
|
|
|
|
import type { TEditInputSchema } from "./edit.schema";
|
|
|
|
type EditOptions = {
|
|
ctx: {
|
|
user: NonNullable<TrpcSessionUser>;
|
|
};
|
|
input: TEditInputSchema;
|
|
};
|
|
|
|
export const editHandler = async ({ input }: EditOptions) => {
|
|
const { id, ...data } = input;
|
|
|
|
const webhook = await prisma.webhook.findFirst({
|
|
where: {
|
|
id,
|
|
},
|
|
});
|
|
|
|
if (!webhook) {
|
|
return null;
|
|
}
|
|
return await prisma.webhook.update({
|
|
where: {
|
|
id,
|
|
},
|
|
data,
|
|
});
|
|
};
|