mirror of
https://github.com/formbricks/formbricks.git
synced 2026-02-08 10:30:27 -06:00
27 lines
486 B
TypeScript
27 lines
486 B
TypeScript
import { revalidateTag } from "next/cache";
|
|
|
|
interface RevalidateProps {
|
|
id?: string;
|
|
teamId?: string;
|
|
}
|
|
|
|
export const inviteCache = {
|
|
tag: {
|
|
byId(id: string) {
|
|
return `invites-${id}`;
|
|
},
|
|
byTeamId(teamId: string) {
|
|
return `teams-${teamId}-invites`;
|
|
},
|
|
},
|
|
revalidate({ id, teamId }: RevalidateProps): void {
|
|
if (id) {
|
|
revalidateTag(this.tag.byId(id));
|
|
}
|
|
|
|
if (teamId) {
|
|
revalidateTag(this.tag.byTeamId(teamId));
|
|
}
|
|
},
|
|
};
|