Skip to content

Commit

Permalink
implement create() (room)
Browse files Browse the repository at this point in the history
create(@Body() createRoomDto: CreateRoomDto) だとうまくいかず
一旦、any で受け取ってからcreate() に渡すと成功した
  • Loading branch information
kotto5 committed Nov 9, 2023
1 parent 43d11f4 commit c048b59
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions backend/src/room/dto/create-room.dto.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import {ApiProperty, ApiPropertyOptional} from '@nestjs/swagger';

Check failure on line 1 in backend/src/room/dto/create-room.dto.ts

View workflow job for this annotation

GitHub Actions / Lint Backend

'ApiPropertyOptional' is defined but never used

export class CreateRoomDto {
@ApiProperty()
id: number;

@ApiProperty()
name: string;
}
4 changes: 2 additions & 2 deletions backend/src/room/room.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ export class RoomController {
constructor(private readonly roomService: RoomService) {}

@Post()
create(@Body() createRoomDto: CreateRoomDto) {
return this.roomService.create(createRoomDto);
create(@Body() body: any) {
return this.roomService.create(body);
}

@Get()
Expand Down

0 comments on commit c048b59

Please sign in to comment.