refactor: distribute types from crm-types.ts to owning composables
Each composable now owns its types and exports them. Other composables import types from the owning composable. Deleted centralized crm-types.ts. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -5,10 +5,24 @@ import {
|
||||
CreateWorkspaceDocumentDocument,
|
||||
DeleteWorkspaceDocumentDocument,
|
||||
} from "~~/graphql/generated";
|
||||
import type { WorkspaceDocument, DocumentSortMode, ClientTimelineItem } from "~/composables/crm-types";
|
||||
import { safeTrim } from "~/composables/crm-types";
|
||||
import { formatDocumentScope } from "~/composables/useWorkspaceDocuments";
|
||||
|
||||
|
||||
export type DocumentSortMode = "updatedAt" | "title" | "owner";
|
||||
|
||||
export type WorkspaceDocument = {
|
||||
id: string;
|
||||
title: string;
|
||||
type: "Regulation" | "Playbook" | "Policy" | "Template";
|
||||
owner: string;
|
||||
scope: string;
|
||||
updatedAt: string;
|
||||
summary: string;
|
||||
body: string;
|
||||
};
|
||||
|
||||
function safeTrim(value: unknown) { return String(value ?? "").trim(); }
|
||||
|
||||
export function useDocuments(opts: { apolloAuthReady: ComputedRef<boolean> }) {
|
||||
const { result: documentsResult, refetch: refetchDocuments } = useQuery(
|
||||
DocumentsQueryDocument,
|
||||
|
||||
Reference in New Issue
Block a user