@cryptotaxi247 / CoPilot / commits / 4225f99a

updated agent interface

Davide Di Modica committed Oct 6, 2023 at 17:30 UTC 4225f99a7d84defc027ec01bf5d184d97eb7f981
3 files changed +3 -3
src/api/agents.ts
+1 -1
@@ -4,7 +4,7 @@ import type { Agent, AgentVulnerabilities, OutdatedWazuhAgents, OutdatedVelocira
4
5 export default {
6 getAgents(id?: string) {
7 - return HttpClient.get<FlaskBaseResponse & { agent?: Agent; agents?: Agent[] }>(`/agents${id ? "/" + id : ""}`)
7 + return HttpClient.get<FlaskBaseResponse & { agents: Agent[] }>(`/agents${id ? "/" + id : ""}`)
8 },
9 markCritical(id: string) {
10 return HttpClient.post<FlaskBaseResponse>(`/agents/${id}/critical`)
src/api/auth.ts
+1 -1
@@ -10,6 +10,6 @@ export default {
10 return HttpClient.post<FlaskBaseResponse>("/auth/register", payload)
11 },
12 refresh() {
13 - return HttpClient.get<FlaskBaseResponse & { token: string }>("/refresh")
13 + return HttpClient.get<FlaskBaseResponse & { token: string }>("/auth/refresh")
14 }
15 }
src/views/socfortress/AgentOverview.vue
+1 -1
@@ -90,7 +90,7 @@ function getAgent(id: string) {
90 .getAgents(id)
91 .then(res => {
92 if (res.data.success) {
93 - agent.value = res.data.agent || null
93 + agent.value = res.data.agents[0] || null
94 } else {
95 message.error(res.data?.message || "An error occurred. Please try again later.")
96 router.push(`/agents`).catch(() => {})