mirror of
https://github.com/formbricks/formbricks.git
synced 2025-12-30 18:30:32 -06:00
27 lines
558 B
TypeScript
27 lines
558 B
TypeScript
import { revalidateTag } from "next/cache";
|
|
|
|
interface RevalidateProps {
|
|
id?: string;
|
|
organizationId?: string;
|
|
}
|
|
|
|
export const inviteCache = {
|
|
tag: {
|
|
byId(id: string) {
|
|
return `invites-${id}`;
|
|
},
|
|
byOrganizationId(organizationId: string) {
|
|
return `organizations-${organizationId}-invites`;
|
|
},
|
|
},
|
|
revalidate({ id, organizationId }: RevalidateProps): void {
|
|
if (id) {
|
|
revalidateTag(this.tag.byId(id));
|
|
}
|
|
|
|
if (organizationId) {
|
|
revalidateTag(this.tag.byOrganizationId(organizationId));
|
|
}
|
|
},
|
|
};
|