initial commit
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import { Controller, Get, Put, Body } from '@nestjs/common';
|
||||
import { NightModeService } from './night-mode.service';
|
||||
import { NightModeDto } from './dto/night-mode.dto';
|
||||
import { CurrentUser } from '../common/decorators/current-user.decorator';
|
||||
import { User } from '../users/entities/user.entity';
|
||||
|
||||
@Controller('user/night-mode')
|
||||
export class NightModeController {
|
||||
constructor(private nightModeService: NightModeService) {}
|
||||
|
||||
@Get()
|
||||
get(@CurrentUser() user: User) {
|
||||
return this.nightModeService.get(user.id);
|
||||
}
|
||||
|
||||
@Put()
|
||||
update(@CurrentUser() user: User, @Body() dto: NightModeDto) {
|
||||
return this.nightModeService.update(user.id, dto);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user