mirror of https://github.com/coder/coder.git
Fix xray query
This commit is contained in:
parent
e04ebb6810
commit
495fe25a76
|
@ -1,9 +1,14 @@
|
|||
import type { GetJFrogXRayScanParams } from "api/api";
|
||||
import * as API from "api/api";
|
||||
import type { WorkspaceAgentStatus } from "api/typesGenerated";
|
||||
|
||||
export const xrayScan = (params: GetJFrogXRayScanParams) => {
|
||||
export const xrayScan = (
|
||||
params: GetJFrogXRayScanParams,
|
||||
status: WorkspaceAgentStatus,
|
||||
) => {
|
||||
return {
|
||||
queryKey: ["xray", params],
|
||||
// Reload the xray results whenever the status changes
|
||||
queryKey: ["xray", params, status],
|
||||
queryFn: () => API.getJFrogXRayScan(params),
|
||||
};
|
||||
};
|
||||
|
|
|
@ -72,8 +72,7 @@ export const AgentRow: FC<AgentRowProps> = ({
|
|||
}) => {
|
||||
// XRay integration
|
||||
const xrayScanQuery = useQuery(
|
||||
[agent.status],
|
||||
xrayScan({ workspaceId: workspace.id, agentId: agent.id }),
|
||||
xrayScan({ workspaceId: workspace.id, agentId: agent.id }, agent.status),
|
||||
);
|
||||
|
||||
// Apps visibility
|
||||
|
|
Loading…
Reference in New Issue