mirror of
https://github.com/multica-ai/multica.git
synced 2026-07-05 13:29:44 +02:00
- Settings → Integrations: new tab with Connect GitHub / installations list / disconnect, gated on the deployment having the App configured. - Issue detail sidebar: Pull requests section showing linked PR title, repo, state (open/draft/merged/closed), and author, with deep link to GitHub. - Real-time refresh: github_installation:* and pull_request:* events invalidate the matching TanStack Query caches. Co-authored-by: multica-agent <github@multica.ai>
23 lines
757 B
TypeScript
23 lines
757 B
TypeScript
import { queryOptions } from "@tanstack/react-query";
|
|
import { api } from "../api";
|
|
|
|
export const githubKeys = {
|
|
all: (wsId: string) => ["github", wsId] as const,
|
|
installations: (wsId: string) => [...githubKeys.all(wsId), "installations"] as const,
|
|
pullRequests: (issueId: string) => ["github", "pull-requests", issueId] as const,
|
|
};
|
|
|
|
export const githubInstallationsOptions = (wsId: string) =>
|
|
queryOptions({
|
|
queryKey: githubKeys.installations(wsId),
|
|
queryFn: () => api.listGitHubInstallations(wsId),
|
|
enabled: !!wsId,
|
|
});
|
|
|
|
export const issuePullRequestsOptions = (issueId: string) =>
|
|
queryOptions({
|
|
queryKey: githubKeys.pullRequests(issueId),
|
|
queryFn: () => api.listIssuePullRequests(issueId),
|
|
enabled: !!issueId,
|
|
});
|