mirror of
https://github.com/dadosfera/maestro.git
synced 2026-11-18 12:29:08 +00:00
FIX: fixed some merge conflicts
This commit is contained in:
@@ -20,6 +20,7 @@ import {
|
||||
DatabaseConnectionPropertiesDto,
|
||||
} from '../connection/dtos/connection';
|
||||
import { RequestUser } from 'src/authentication/user.decorator';
|
||||
import { PackTheMetadata } from 'src/utils/ PackTheMetadata';
|
||||
|
||||
@Injectable()
|
||||
export class ConnectionTestService {
|
||||
@@ -46,17 +47,20 @@ export class ConnectionTestService {
|
||||
connection_id,
|
||||
} = body;
|
||||
const { user_id, customer_id, customer_name } = user;
|
||||
const info = { customer_name, customer_id, user_id };
|
||||
const metadata = PackTheMetadata({
|
||||
customer_name,
|
||||
customer_id,
|
||||
user_id,
|
||||
});
|
||||
|
||||
if (connection_id) {
|
||||
const con = await this.connectionsService.getConnectionDetails({
|
||||
body,
|
||||
info,
|
||||
metadata,
|
||||
});
|
||||
const conPayload = JSON.parse(con.connection.properties);
|
||||
const { plugin, network_config_id } = con.connection;
|
||||
const { host, port, endpoint } = conPayload;
|
||||
console.log(plugin);
|
||||
|
||||
return lastValueFrom(
|
||||
this.connectionTestReadClient.ConnectionTestPing({
|
||||
@@ -87,7 +91,13 @@ export class ConnectionTestService {
|
||||
): Promise<ConnectionTestCredentialsRes> {
|
||||
const { plugin, ...connectionBody } = body;
|
||||
let { connection_id } = body;
|
||||
const { customer_id, customer_name, user_id } = user;
|
||||
const { customer_id, customer_name, user_id, username } = user;
|
||||
const metadata = PackTheMetadata({
|
||||
customer_id,
|
||||
customer_name,
|
||||
user_id,
|
||||
username,
|
||||
});
|
||||
|
||||
/********* CREATE CONNECTION *********/
|
||||
if (!connection_id) {
|
||||
@@ -117,7 +127,7 @@ export class ConnectionTestService {
|
||||
if (!body.connection_id) {
|
||||
await this.connectionsService.deleteConnection({
|
||||
body: { id: connection_id },
|
||||
info: { customer_id, customer_name, user_id },
|
||||
metadata,
|
||||
});
|
||||
}
|
||||
throw e;
|
||||
@@ -125,7 +135,7 @@ export class ConnectionTestService {
|
||||
if (!operation_result && !body.connection_id) {
|
||||
await this.connectionsService.deleteConnection({
|
||||
body: { id: connection_id },
|
||||
info: { customer_id, customer_name, user_id },
|
||||
metadata,
|
||||
});
|
||||
connection_id = null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user