mirror of
https://github.com/louislam/dockge.git
synced 2024-12-02 15:14:03 +00:00
fix(agent-manager): add update query
add a query to update the friendlyname correctly
This commit is contained in:
parent
5885665b4d
commit
2b64b3f9dd
1 changed files with 1 additions and 9 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue