Skip to content

Commit cf36573

Browse files
fix: fetch full connection before renaming to preserve all fields
Previously sent a partial PUT that could overwrite password, SSL, and other settings with defaults, breaking the connection. Now fetches the current connection first and only changes the title. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 1aa1476 commit cf36573

1 file changed

Lines changed: 8 additions & 14 deletions

File tree

frontend/src/app/components/connections-list/hosted-database-rename-dialog/hosted-database-rename-dialog.component.ts

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,15 @@ export class HostedDatabaseRenameDialogComponent {
4040

4141
this.saving = true;
4242
try {
43-
const db = this.data.hostedDatabase;
43+
// Fetch the current connection to preserve all fields
44+
const res = await firstValueFrom(
45+
this._http.get<any>(`/connection/one/${this.data.connectionId}`),
46+
);
47+
const connection = res.connection;
48+
connection.title = title;
49+
4450
await firstValueFrom(
45-
this._http.put(`/connection/${this.data.connectionId}`, {
46-
title,
47-
host: db.hostname,
48-
port: db.port,
49-
database: db.databaseName,
50-
username: db.username,
51-
type: 'postgres',
52-
ssl: false,
53-
ssh: false,
54-
masterEncryption: false,
55-
azure_encryption: false,
56-
connectionType: 'direct',
57-
}),
51+
this._http.put(`/connection/${this.data.connectionId}`, connection),
5852
);
5953
this._connectionsService.fetchConnections().subscribe();
6054
this._dialogRef.close(title);

0 commit comments

Comments
 (0)