mirror of
https://dev.azure.com/globalhealthx/EMR/_git/helix-engage-server
synced 2026-04-11 18:08:16 +00:00
feat: theme config service — REST API with versioning + backup
- 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>
This commit is contained in:
27
src/config/theme.controller.ts
Normal file
27
src/config/theme.controller.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user