Skip to content

Commit bf3037d

Browse files
mdm317kart1kaanikdhabal
authored
fix: add cache invalidation after creating Availability (calcom#23221)
Co-authored-by: Kartik Saini <41051387+kart1ka@users.noreply.github.com> Co-authored-by: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com>
1 parent 5ebd335 commit bf3037d

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

packages/features/schedules/components/NewScheduleButton.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { revalidateAvailabilityList } from "app/(use-page-wrapper)/(main-nav)/availability/actions";
12
import { useRouter } from "next/navigation";
23
import { useForm } from "react-hook-form";
34

@@ -31,6 +32,7 @@ export function NewScheduleButton({
3132
onSuccess: async ({ schedule }) => {
3233
await router.push(`/availability/${schedule.id}${fromEventType ? "?fromEventType=true" : ""}`);
3334
showToast(t("schedule_created_successfully", { scheduleName: schedule.name }), "success");
35+
revalidateAvailabilityList();
3436
utils.viewer.availability.list.setData(undefined, (data) => {
3537
const newSchedule = { ...schedule, isDefault: false, availability: [] };
3638
if (!data)

0 commit comments

Comments
 (0)