Test connection string now uses the currently typed in connection string rather than the last saved one

This commit is contained in:
Isaac Abadi
2021-07-26 20:31:35 -07:00
parent fb5c13db27
commit 258d5ff495
5 changed files with 15 additions and 10 deletions

View File

@@ -195,8 +195,8 @@ export class PostsService implements CanActivate {
return this.http.post(this.path + 'transferDB', {local_to_remote: local_to_remote}, this.httpOptions);
}
testConnectionString() {
return this.http.post(this.path + 'testConnectionString', {}, this.httpOptions);
testConnectionString(connection_string) {
return this.http.post(this.path + 'testConnectionString', {connection_string: connection_string}, this.httpOptions);
}
killAllDownloads() {

View File

@@ -301,7 +301,7 @@
</mat-form-field>
<div class="test-connection-div">
<button (click)="testConnectionString()" [disabled]="testing_connection_string" mat-flat-button color="accent"><ng-container i18n="Test connection string button">Test connection string</ng-container></button>
<button (click)="testConnectionString(new_config['Database']['mongodb_connection_string'])" [disabled]="testing_connection_string" mat-flat-button color="accent"><ng-container i18n="Test connection string button">Test connection string</ng-container></button>
</div>
<div class="transfer-db-div">

View File

@@ -307,9 +307,9 @@ export class SettingsComponent implements OnInit {
});
}
testConnectionString() {
testConnectionString(connection_string) {
this.testing_connection_string = true;
this.postsService.testConnectionString().subscribe(res => {
this.postsService.testConnectionString(connection_string).subscribe(res => {
this.testing_connection_string = false;
if (res['success']) {
this.postsService.openSnackBar('Connection successful!');