mirror of
https://github.com/immich-app/immich.git
synced 2025-01-10 05:46:46 +01:00
35 lines
883 B
TypeScript
35 lines
883 B
TypeScript
|
import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common';
|
||
|
import { UserService } from './user.service';
|
||
|
import { CreateUserDto } from './dto/create-user.dto';
|
||
|
import { UpdateUserDto } from './dto/update-user.dto';
|
||
|
|
||
|
@Controller('user')
|
||
|
export class UserController {
|
||
|
constructor(private readonly userService: UserService) {}
|
||
|
|
||
|
@Post()
|
||
|
create(@Body() createUserDto: CreateUserDto) {
|
||
|
return this.userService.create(createUserDto);
|
||
|
}
|
||
|
|
||
|
@Get()
|
||
|
findAll() {
|
||
|
return this.userService.findAll();
|
||
|
}
|
||
|
|
||
|
@Get(':id')
|
||
|
findOne(@Param('id') id: string) {
|
||
|
return this.userService.findOne(+id);
|
||
|
}
|
||
|
|
||
|
@Patch(':id')
|
||
|
update(@Param('id') id: string, @Body() updateUserDto: UpdateUserDto) {
|
||
|
return this.userService.update(+id, updateUserDto);
|
||
|
}
|
||
|
|
||
|
@Delete(':id')
|
||
|
remove(@Param('id') id: string) {
|
||
|
return this.userService.remove(+id);
|
||
|
}
|
||
|
}
|