first commit
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import { Controller, Get } from '@nestjs/common';
|
||||
import { ApiOperation, ApiTags } from '@nestjs/swagger';
|
||||
import { map } from 'rxjs';
|
||||
import { CoreGrpcService } from '../core-grpc.service';
|
||||
|
||||
@ApiTags('Публичные настройки')
|
||||
@Controller('settings')
|
||||
export class PublicSettingsController {
|
||||
constructor(private readonly core: CoreGrpcService) {}
|
||||
|
||||
@Get('public')
|
||||
@ApiOperation({ summary: 'Публичные настройки', description: 'Возвращает несекретные настройки для интерфейса без авторизации.' })
|
||||
listPublic() {
|
||||
return this.core.settings.ListPublicSettings({}).pipe(
|
||||
map((response) => {
|
||||
const payload = response as { settings?: Array<{ key: string; value: string }> };
|
||||
return { settings: payload.settings ?? [] };
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user