Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

635 B
Raw Blame
import { storageServiceClient } from '@service-storage/client';
import type { SerializedEditorState } from 'lexical';
import { queryClient } from '../client';
import { snippetRawKeys } from './keys';

type SnippetRawArgs = {
  documentId: string;
};

function snippetRawQueryOptions(args: SnippetRawArgs) {
  return {
    queryKey: snippetRawKeys.document(args.documentId).queryKey,
    queryFn: () => storageServiceClient.getSnippetRaw(args),
    staleTime: 60 * 1000,
  };
}

export function fetchSnippetRaw(
  args: SnippetRawArgs
): Promise<SerializedEditorState> {
  return queryClient.fetchQuery(snippetRawQueryOptions(args));
}