Skip to content

Open source alternative to Semrush and Ahrefs

520 B
Raw Blame
import { queryOptions } from "@tanstack/react-query";
import { queryClient } from "@/client/tanstack-db";
import { listSamSessions } from "@/serverFunctions/sam";

export const samSessionsQueryOptions = (projectId: string) =>
  queryOptions({
    queryKey: ["samSessions", projectId],
    queryFn: () => listSamSessions({ data: { projectId } }),
  });

export function invalidateSamSessions(projectId: string) {
  return queryClient.invalidateQueries({
    queryKey: samSessionsQueryOptions(projectId).queryKey,
  });
}