revalidate event type page on update (#7685)

feat/edit-location-dialog-select
Efraín Rochín 2023-03-20 04:21:14 -07:00 committed by GitHub
parent ee8b2e67f0
commit 5d7685f2c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -2,6 +2,7 @@ import { MembershipRole, PeriodType, Prisma, SchedulingType } from "@prisma/clie
import { PrismaClientKnownRequestError } from "@prisma/client/runtime/library";
// REVIEW: From lint error
import _ from "lodash";
import type { NextApiResponse } from "next";
import { z } from "zod";
import getAppKeysFromSlug from "@calcom/app-store/_utils/getAppKeysFromSlug";
@ -700,7 +701,10 @@ export const eventTypesRouter = router({
where: { id },
data,
});
const res = ctx.res as NextApiResponse;
if (typeof res?.revalidate !== "undefined") {
await res?.revalidate(`/${ctx.user.username}/${eventType.slug}`);
}
return { eventType };
}),
delete: eventOwnerProcedure