fix: add cache invalidation after creating Availability (#23221)
Co-authored-by: Kartik Saini <[email protected]> Co-authored-by: Anik Dhabal Babu <[email protected]>
This commit is contained in:
1 file changed
+2
@@ -1,3 +1,4 @@
|
||||
import { revalidateAvailabilityList } from "app/(use-page-wrapper)/(main-nav)/availability/actions";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useForm } from "react-hook-form";
|
||||
|
||||
@@ -31,6 +32,7 @@ export function NewScheduleButton({
|
||||
onSuccess: async ({ schedule }) => {
|
||||
await router.push(`/availability/${schedule.id}${fromEventType ? "?fromEventType=true" : ""}`);
|
||||
showToast(t("schedule_created_successfully", { scheduleName: schedule.name }), "success");
|
||||
revalidateAvailabilityList();
|
||||
utils.viewer.availability.list.setData(undefined, (data) => {
|
||||
const newSchedule = { ...schedule, isDefault: false, availability: [] };
|
||||
if (!data)
|
||||
|
||||
Reference in new issue
Block a user