mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-15 02:20:38 +09:00
Handle unresolved agent shortnames without UUID errors
This commit is contained in:
parent
2405851436
commit
63c0e22a2a
2 changed files with 9 additions and 5 deletions
|
|
@ -264,11 +264,12 @@ export function AgentDetail() {
|
|||
const resolvedCompanyId = agent?.companyId ?? selectedCompanyId;
|
||||
const canonicalAgentRef = agent ? agentRouteRef(agent) : routeAgentRef;
|
||||
const agentLookupRef = agent?.id ?? routeAgentRef;
|
||||
const resolvedAgentId = agent?.id ?? null;
|
||||
|
||||
const { data: runtimeState } = useQuery({
|
||||
queryKey: queryKeys.agents.runtimeState(agentLookupRef),
|
||||
queryFn: () => agentsApi.runtimeState(agentLookupRef, resolvedCompanyId ?? undefined),
|
||||
enabled: Boolean(agentLookupRef),
|
||||
queryKey: queryKeys.agents.runtimeState(resolvedAgentId ?? routeAgentRef),
|
||||
queryFn: () => agentsApi.runtimeState(resolvedAgentId!, resolvedCompanyId ?? undefined),
|
||||
enabled: Boolean(resolvedAgentId),
|
||||
});
|
||||
|
||||
const { data: heartbeats } = useQuery({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue