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