From 2b64b3f9dd17734397c86adfab4ebdee104c7980 Mon Sep 17 00:00:00 2001 From: stroskler Date: Tue, 6 Feb 2024 06:55:29 +0000 Subject: [PATCH] fix(agent-manager): add update query add a query to update the friendlyname correctly --- backend/agent-manager.ts | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/backend/agent-manager.ts b/backend/agent-manager.ts index 3d57a53..e5374de 100644 --- a/backend/agent-manager.ts +++ b/backend/agent-manager.ts @@ -114,15 +114,7 @@ export class AgentManager { */ async update(friendlyname : string, updatedFriendlyName : string) { - let bean = await R.findOne("agent", " friendlyname = ? ", [ - friendlyname, - ]); - - if (bean) { - bean.friendlyname = updatedFriendlyName; - } else { - throw new Error("Friendly name could not be updated "); - } + await R.exec('UPDATE agent SET friendlyname = "' + updatedFriendlyName + '" WHERE friendlyname = "' + friendlyname + '"'); } connect(url : string, username : string, password : string) {