mirror of
https://github.com/dadosfera/maestro.git
synced 2026-11-14 20:19:08 +00:00
FIX: Findone pipeline
This commit is contained in:
@@ -130,22 +130,30 @@ export class PipelinesController {
|
||||
|
||||
let result: any = [];
|
||||
|
||||
if (id.split('_').length > 1) {
|
||||
result = await this.pipelinesClientService.findOne({ id }, metadata);
|
||||
|
||||
Object.assign(result.pipeline, {
|
||||
transformations: JSON.parse(result.pipeline.transformations),
|
||||
config: {
|
||||
cron: result.pipeline.config.cron,
|
||||
tables: JSON.parse(result.pipeline.config.tables),
|
||||
},
|
||||
result = await this.pipelinesClientService
|
||||
.findOne({ id }, metadata)
|
||||
.then((res) => {
|
||||
Object.assign(res.pipeline, {
|
||||
transformations: res.pipeline.transformations
|
||||
? JSON.parse(res.pipeline.transformations)
|
||||
: [],
|
||||
config: {
|
||||
cron: res.pipeline.config.cron,
|
||||
tables: JSON.parse(res.pipeline.config.tables),
|
||||
},
|
||||
properties: res.pipeline.properties
|
||||
? JSON.parse(res.pipeline.properties)
|
||||
: {},
|
||||
});
|
||||
return res;
|
||||
})
|
||||
.catch(async (err) => {
|
||||
this.logger.error(err);
|
||||
return await this.oldPipelinesService.findOne({
|
||||
id,
|
||||
info: { customer_id, customer: customer_name, user_id },
|
||||
});
|
||||
});
|
||||
} else {
|
||||
result = await this.oldPipelinesService.findOne({
|
||||
id,
|
||||
info: { customer_id, customer: customer_name, user_id },
|
||||
});
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user