fix(agent-manager): add update query

add a query to update the friendlyname correctly
This commit is contained in:
stroskler 2024-02-06 06:55:29 +00:00
parent 5885665b4d
commit 2b64b3f9dd
No known key found for this signature in database
GPG key ID: BFC1D7C45DD50847

View file

@ -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) {