• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stacklok / codegate-ui / 12812794630

16 Jan 2025 04:02PM UTC coverage: 67.279% (-1.4%) from 68.657%
12812794630

Pull #95

github

web-flow
Merge 4e40678d3 into 04a065f0d
Pull Request #95: refactor: use react-query for fetching alerts

201 of 379 branches covered (53.03%)

Branch coverage included in aggregate %.

385 of 492 relevant lines covered (78.25%)

27.49 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

25.0
/src/hooks/usePromptsData.ts
1
import { useQuery } from "@tanstack/react-query";
2
import { serverApi } from "@/api/service";
3
import { Conversation } from "@/api/generated";
4

5
const fetchPrompts = async (): Promise<Conversation[]> => {
1✔
6
  const { getMessagesDashboardMessagesGet } = await serverApi();
×
7
  const { data } = await getMessagesDashboardMessagesGet();
×
8

9
  if (!data) return [];
×
10

11
  return data.filter((prompt) =>
×
12
    prompt.question_answers?.every((item) => item.answer && item.question),
×
13
  );
14
};
15

16
export const usePromptsData = () => {
1✔
17
  return useQuery({
4✔
18
    queryKey: ["prompts"],
19
    queryFn: fetchPrompts,
20
  });
21
};
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc