From f61c241dde9eb102ca46819a992afc59b9b86ffd Mon Sep 17 00:00:00 2001 From: Rafael Date: Thu, 18 Dec 2025 10:30:09 -0300 Subject: [PATCH] FIX: inject customer_id in pipeline execute/pause/unpause routes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Users no longer need to provide customer_id in the request body for execute, pause, and unpause pipeline operations - it's now automatically injected from the authenticated user's session. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../platform-api/platform-api.controller.ts | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/src/modules/platform-api/platform-api.controller.ts b/src/modules/platform-api/platform-api.controller.ts index 78b273e..e0d59f2 100644 --- a/src/modules/platform-api/platform-api.controller.ts +++ b/src/modules/platform-api/platform-api.controller.ts @@ -630,21 +630,39 @@ export class PlatformApiController { @ApiOperation({ summary: 'Execute a pipeline' }) @RequireAllPermissions(PERMISSIONS_GROUPS.PIPELINE.permissions.UPDATE) async executePipeline(@Body() body: any, @User() user: RequestUser) { - return this.platformApiService.proxy('POST', '/pipeline/execute', user, body); + // Inject customer_id (actually customer_name) into body for Platform-API + // Note: Platform-API was created before customer_id existed, so it expects customer_name in the customer_id field + const enrichedBody = { + ...body, + customer_id: user.customer_name, + }; + return this.platformApiService.proxy('POST', '/pipeline/execute', user, enrichedBody); } @Post('pipeline/pause') @ApiOperation({ summary: 'Pause a pipeline' }) @RequireAllPermissions(PERMISSIONS_GROUPS.PIPELINE.permissions.UPDATE) async pausePipeline(@Body() body: any, @User() user: RequestUser) { - return this.platformApiService.proxy('POST', '/pipeline/pause', user, body); + // Inject customer_id (actually customer_name) into body for Platform-API + // Note: Platform-API was created before customer_id existed, so it expects customer_name in the customer_id field + const enrichedBody = { + ...body, + customer_id: user.customer_name, + }; + return this.platformApiService.proxy('POST', '/pipeline/pause', user, enrichedBody); } @Post('pipeline/unpause') @ApiOperation({ summary: 'Unpause a pipeline' }) @RequireAllPermissions(PERMISSIONS_GROUPS.PIPELINE.permissions.UPDATE) async unpausePipeline(@Body() body: any, @User() user: RequestUser) { - return this.platformApiService.proxy('POST', '/pipeline/unpause', user, body); + // Inject customer_id (actually customer_name) into body for Platform-API + // Note: Platform-API was created before customer_id existed, so it expects customer_name in the customer_id field + const enrichedBody = { + ...body, + customer_id: user.customer_name, + }; + return this.platformApiService.proxy('POST', '/pipeline/unpause', user, enrichedBody); } @Put('pipeline/:pipelineId/memory')