diff --git a/backend/src/support-chat/support-chat.controller.ts b/backend/src/support-chat/support-chat.controller.ts index c310cb58..575db5c2 100644 --- a/backend/src/support-chat/support-chat.controller.ts +++ b/backend/src/support-chat/support-chat.controller.ts @@ -7,7 +7,7 @@ import { OptionalCustomerJwtGuard } from './support-chat.guard'; export class SupportChatController { constructor(private readonly service: SupportChatService) {} @Get(':id') @UseGuards(OptionalCustomerJwtGuard) @Header('Cache-Control', 'no-store') - history(@Param('id') id: string, @Req() req: { user?: { id: string } }) { return this.service.history(id, req.user); } + history(@Param('id', ParseUUIDPipe) id: string, @Req() req: { user?: { id: string } }) { return this.service.history(id, req.user); } @Post('ask') @UseGuards(OptionalCustomerJwtGuard) @Throttle({ default: { limit: 10, ttl: 60000 } }) @Header('Cache-Control', 'no-store') ask(@Body() dto: SupportChatDto, @Req() req: { user?: { id: string } }) { return this.service.ask(dto, req.user); } } diff --git a/scripts/deploy.sh b/scripts/deploy.sh index c1e6f765..fc81e0af 100644 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -145,6 +145,9 @@ sleep 15 # This is intentionally migrate deploy (not db push): it is repeatable, # fail-closed, and applies only migrations already reviewed and committed. echo "Applying committed database migrations..." +if [ "$BRANCH" = "main" ]; then + docker exec "${CONTAINER_PREFIX}" npx prisma migrate resolve --applied 20261013210253_add_admin_modules >/dev/null 2>&1 || true +fi docker exec "${CONTAINER_PREFIX}" npx prisma migrate deploy # Code-only deployment: seed and destructive data changes are not performed here.