mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-21 15:20:34 +00:00
feat(nestjs): migrate to NestJS
This commit is contained in:
24
packages/server/src/modules/Settings/Settings.controller.ts
Normal file
24
packages/server/src/modules/Settings/Settings.controller.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { Body, Controller, Get, Post, Put } from '@nestjs/common';
|
||||
import { SettingsApplicationService } from './SettingsApplication.service';
|
||||
import { ISettingsDTO } from './Settings.types';
|
||||
import { ApiOperation, ApiTags } from '@nestjs/swagger';
|
||||
|
||||
@Controller('settings')
|
||||
@ApiTags('settings')
|
||||
export class SettingsController {
|
||||
constructor(
|
||||
private readonly settingsApplicationService: SettingsApplicationService,
|
||||
) {}
|
||||
|
||||
@Put('')
|
||||
@ApiOperation({ summary: 'Save the given settings.' })
|
||||
async saveSettings(@Body() settingsDTO: ISettingsDTO) {
|
||||
return this.settingsApplicationService.saveSettings(settingsDTO);
|
||||
}
|
||||
|
||||
@Get('')
|
||||
@ApiOperation({ summary: 'Retrieves the settings.' })
|
||||
async getSettings() {
|
||||
return this.settingsApplicationService.getSettings();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user