fix: missing places for revalidations (#21632)
This commit is contained in:
@@ -20,8 +20,8 @@ const getCachedAttributes = unstable_cache(
|
||||
async (orgId: number) => {
|
||||
return await AttributeRepository.findAllByOrgIdWithOptions({ orgId });
|
||||
},
|
||||
["viewer.attributes.list"],
|
||||
{ revalidate: 3600 } // Cache for 1 hour
|
||||
undefined,
|
||||
{ revalidate: 3600, tags: ["viewer.attributes.list"] } // Cache for 1 hour
|
||||
);
|
||||
|
||||
const Page = async () => {
|
||||
|
||||
+3
-1
@@ -7,8 +7,9 @@ import { z } from "zod";
|
||||
import LicenseRequired from "@calcom/features/ee/common/components/LicenseRequired";
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { trpc } from "@calcom/trpc/react";
|
||||
import { showToast } from "@calcom/ui/components/toast";
|
||||
import { Button } from "@calcom/ui/components/button";
|
||||
import { showToast } from "@calcom/ui/components/toast";
|
||||
import { revalidateAttributesList } from "@calcom/web/app/(use-page-wrapper)/settings/organizations/members/actions";
|
||||
|
||||
import { AttributeForm } from "./AttributesForm";
|
||||
|
||||
@@ -26,6 +27,7 @@ function CreateAttributesPage() {
|
||||
const mutation = trpc.viewer.attributes.create.useMutation({
|
||||
onSuccess: () => {
|
||||
showToast("Attribute created successfully", "success");
|
||||
revalidateAttributesList();
|
||||
router.push("/settings/organizations/attributes");
|
||||
},
|
||||
onError: (err) => {
|
||||
|
||||
@@ -19,6 +19,7 @@ import {
|
||||
import { Switch } from "@calcom/ui/components/form";
|
||||
import { Icon } from "@calcom/ui/components/icon";
|
||||
import { showToast } from "@calcom/ui/components/toast";
|
||||
import { revalidateAttributesList } from "@calcom/web/app/(use-page-wrapper)/settings/organizations/members/actions";
|
||||
|
||||
import { DeleteAttributeModal } from "./DeleteAttributeModal";
|
||||
import { ListSkeleton } from "./ListSkeleton";
|
||||
@@ -44,6 +45,7 @@ function AttributeItem({
|
||||
const mutation = trpc.viewer.attributes.toggleActive.useMutation({
|
||||
onSuccess: () => {
|
||||
showToast(t("attribute_updated_successfully"), "success");
|
||||
revalidateAttributesList();
|
||||
},
|
||||
onError: (err) => {
|
||||
showToast(err.message, "error");
|
||||
|
||||
Reference in New Issue
Block a user