Compare commits

...
2 Commits
Author SHA1 Message Date
Gabriel Amorim 74c27d9637 Merge pull request #133 from dadosfera/fix/connections-migration
FIX: get all connectors fixed
2022-09-12 16:11:08 -03:00
Gabriel Rosa 216c83d7fa FIX: get all connectors fixed 2022-09-12 16:08:11 -03:00
3 changed files with 31 additions and 21 deletions
+27 -17
View File
@@ -214,10 +214,18 @@ export class ConnectionClientService implements OnModuleInit {
this.INTERNAL_getAllConnections({ customer_name }).then((res) => ({
customer_name,
customer_id,
platformConnections: JSON.parse(res.platformConnections),
productConnections: JSON.parse(res.productConnections),
productNetworkConfigs: JSON.parse(res.productNetworkConfigs),
platformNetworkConfigs: JSON.parse(res.platformNetworkConfigs),
platformConnections: res.platformConnections
? JSON.parse(res.platformConnections)
: [],
productConnections: res.productConnections
? JSON.parse(res.productConnections)
: [],
productNetworkConfigs: res.productNetworkConfigs
? JSON.parse(res.productNetworkConfigs)
: [],
platformNetworkConfigs: res.platformNetworkConfigs
? JSON.parse(res.platformNetworkConfigs)
: [],
})),
);
});
@@ -235,20 +243,22 @@ export class ConnectionClientService implements OnModuleInit {
customer_id,
} = cc;
platformConnections.forEach((plc) => {
const productConnection = productConnections.find(
(prc) => prc.id === plc.config_id,
);
if (!productConnection) productConnectionsMissing.push(plc);
});
platformConnections &&
platformConnections.forEach((plc) => {
const productConnection = productConnections.find(
(prc) => prc.id === plc.config_id,
);
if (!productConnection) productConnectionsMissing.push(plc);
});
platformNetworkConfigs.forEach((platNetConfig) => {
const productNetworkConfig = productNetworkConfigs.find(
(prodNetConfig) => prodNetConfig.id === platNetConfig.config_id,
);
if (!productNetworkConfig)
productNetworkConfigsMissing.push(platNetConfig);
});
platformNetworkConfigs &&
platformNetworkConfigs.forEach((platNetConfig) => {
const productNetworkConfig = productNetworkConfigs.find(
(prodNetConfig) => prodNetConfig.id === platNetConfig.config_id,
);
if (!productNetworkConfig)
productNetworkConfigsMissing.push(platNetConfig);
});
const updatePromises: Promise<any>[] = [];
for (const network_config of productNetworkConfigsMissing) {
@@ -107,7 +107,7 @@ export class ConnectorController {
@Headers('dadosfera-lang') language,
@Query() queries: GetAllDto,
) {
this.logger.info('/upload - Upload Connector Route');
this.logger.info('/GET - getAllConnectors Route');
if (!language) language = 'en-us';
const { search, size, page, ...filters } = queries;
@@ -120,7 +120,7 @@ export class ConnectorController {
page: page || 1,
});
const connectors = JSON.parse(response.connectors).connectors;
const connectors = JSON.parse(response.connectors);
return {
message: response.message,
@@ -153,7 +153,7 @@ export class ConnectorController {
@Param('plugin') plugin: string,
@Query('version') version: string,
) {
this.logger.info('/upload - Upload Connector Route');
this.logger.info('/GET/:plugin - getConnector Route');
if (!language) language = 'en-us';
const pluginId = `${plugin}-${version}`;
+1 -1
View File
File diff suppressed because one or more lines are too long