chore: bootstrap repository with governance docs
Initialize git, add Apache-2.0 LICENSE, .gitattributes (LF line endings), AGENTS.md (entry points, stack, discovery order, baseline checks), RUNBOOK.md (dev boot, prod deploy with overlay, ingestion, failures, rollback, scaling notes), .env.prod.example with rotated credential placeholders, and dev-only warnings on .env.example. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
23
frontend/src/hooks/useIngestion.ts
Normal file
23
frontend/src/hooks/useIngestion.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
||||
import { ingestFolder, listRuns } from "@/services/ingestion";
|
||||
import type { IngestFolderRequest } from "@/services/types";
|
||||
|
||||
export function useIngestionRuns() {
|
||||
return useQuery({
|
||||
queryKey: ["ingestion-runs"],
|
||||
queryFn: listRuns,
|
||||
refetchInterval: 15_000,
|
||||
});
|
||||
}
|
||||
|
||||
export function useStartIngestion() {
|
||||
const qc = useQueryClient();
|
||||
return useMutation({
|
||||
mutationFn: (req: IngestFolderRequest) => ingestFolder(req),
|
||||
onSuccess: () => {
|
||||
qc.invalidateQueries({ queryKey: ["ingestion-runs"] });
|
||||
qc.invalidateQueries({ queryKey: ["documents"] });
|
||||
qc.invalidateQueries({ queryKey: ["dashboard"] });
|
||||
},
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user