Merge branch 'dev-1' into dev

This commit is contained in:
Wuesteon 2025-12-05 17:57:26 +01:00
commit d41d060bb3
1770 changed files with 168028 additions and 31031 deletions

View file

@ -0,0 +1,22 @@
import { Controller, Get, Param } from '@nestjs/common';
import { ThemeService } from './theme.service';
@Controller('themes')
export class ThemeController {
constructor(private readonly themeService: ThemeService) {}
@Get()
async findAll() {
return this.themeService.findAll();
}
@Get('default')
async findDefault() {
return this.themeService.findDefault();
}
@Get(':id')
async findOne(@Param('id') id: string) {
return this.themeService.findOne(id);
}
}

View file

@ -0,0 +1,10 @@
import { Module } from '@nestjs/common';
import { ThemeController } from './theme.controller';
import { ThemeService } from './theme.service';
@Module({
controllers: [ThemeController],
providers: [ThemeService],
exports: [ThemeService],
})
export class ThemeModule {}

View file

@ -0,0 +1,27 @@
import { Injectable, Inject } from '@nestjs/common';
import { eq } from 'drizzle-orm';
import { DATABASE_CONNECTION } from '../db/database.module';
import { Database } from '../db/connection';
import { themes } from '../db/schema';
@Injectable()
export class ThemeService {
constructor(
@Inject(DATABASE_CONNECTION)
private readonly db: Database
) {}
async findAll() {
return this.db.select().from(themes);
}
async findOne(id: string) {
const result = await this.db.select().from(themes).where(eq(themes.id, id));
return result[0] || null;
}
async findDefault() {
const result = await this.db.select().from(themes).where(eq(themes.isDefault, true));
return result[0] || null;
}
}