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')