mirror of
https://dev.azure.com/globalhealthx/EMR/_git/helix-engage-server
synced 2026-04-11 10:07:22 +00:00
- ThemeService: read/write/validate theme.json, auto-backup on save - ThemeController: GET/PUT/POST /api/config/theme (public GET, versioned PUT) - ThemeConfig type with version + updatedAt fields - Default theme: Global Hospital blue scale - ConfigThemeModule registered in AppModule Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
28 lines
750 B
TypeScript
28 lines
750 B
TypeScript
import { Controller, Get, Put, Post, Body, Logger } from '@nestjs/common';
|
|
import { ThemeService } from './theme.service';
|
|
import type { ThemeConfig } from './theme.defaults';
|
|
|
|
@Controller('api/config')
|
|
export class ThemeController {
|
|
private readonly logger = new Logger(ThemeController.name);
|
|
|
|
constructor(private readonly theme: ThemeService) {}
|
|
|
|
@Get('theme')
|
|
getTheme() {
|
|
return this.theme.getTheme();
|
|
}
|
|
|
|
@Put('theme')
|
|
updateTheme(@Body() body: Partial<ThemeConfig>) {
|
|
this.logger.log('Theme update request');
|
|
return this.theme.updateTheme(body);
|
|
}
|
|
|
|
@Post('theme/reset')
|
|
resetTheme() {
|
|
this.logger.log('Theme reset request');
|
|
return this.theme.resetTheme();
|
|
}
|
|
}
|