20 lines
484 B
TypeScript
20 lines
484 B
TypeScript
import { Controller, Get, Put, Body, UseGuards } from '@nestjs/common';
|
|
import { JwtAuthGuard } from '../auth/jwt-auth.guard';
|
|
import { SettingsService } from './settings.service';
|
|
|
|
@UseGuards(JwtAuthGuard)
|
|
@Controller('settings')
|
|
export class SettingsController {
|
|
constructor(private settings: SettingsService) {}
|
|
|
|
@Get()
|
|
getAll() {
|
|
return this.settings.getAll();
|
|
}
|
|
|
|
@Put()
|
|
update(@Body() body: Record<string, string>) {
|
|
return this.settings.setMany(body);
|
|
}
|
|
}
|