mirror of
https://github.com/dadosfera/maestro.git
synced 2026-12-06 22:10:05 +00:00
FEAT: update job deletion logic to mark tables as deleted and adjust API endpoints accordingly
This commit is contained in:
@@ -54,7 +54,7 @@ import { UpdateInputRequest } from '../inputs/dtos/old_interfaces';
|
||||
import { Info } from '@dadosfera/protospack-v2/dist/lib/Input/interfaces/entities';
|
||||
|
||||
type PipelineTable = { name: string; job_id?: string; is_deleted?: boolean; [key: string]: any };
|
||||
type PipelineTablesConfig = { input_id?: string; tables?: PipelineTable[] } | PipelineTable[];
|
||||
type PipelineTablesConfig = { input_id?: string; tables: PipelineTable[] };
|
||||
|
||||
@ApiTags('PipelinesV2')
|
||||
@ApiHeaders([{ name: 'dadosfera-lang', enum: LanguageEnum, required: false }])
|
||||
@@ -229,11 +229,8 @@ export class PipelinesController {
|
||||
const pipelineRes = await this.pipelinesClientService.findOne({ id }, metadata);
|
||||
|
||||
const parsed: PipelineTablesConfig = JSON.parse(pipelineRes.pipeline.config.tables);
|
||||
const input_id = (parsed as { input_id?: string; tables?: PipelineTable[] })?.input_id;
|
||||
const normalizedId = id.replace(/-/g, '_');
|
||||
const tables: PipelineTable[] = (
|
||||
(parsed as { tables?: PipelineTable[] })?.tables ?? (parsed as PipelineTable[])
|
||||
).map((table, index) => ({ ...table, job_id: `${normalizedId}_${index}` }));
|
||||
const input_id = parsed.input_id;
|
||||
const tables: PipelineTable[] = parsed.tables ?? [];
|
||||
|
||||
Object.assign(pipelineRes.pipeline, {
|
||||
transformations: pipelineRes.pipeline.transformations
|
||||
|
||||
Reference in New Issue
Block a user