Feature/update types#138
Conversation
There was a problem hiding this comment.
The validation was removed from this. It does not need expose because it is an incoming DTO
There was a problem hiding this comment.
What is the purpose of this? I thought this worked already.
| return this.jukeSessionService.createMembership(id, body) | ||
| } | ||
|
|
||
| @Post(':id/members/join/') |
There was a problem hiding this comment.
I think the endpoint above this one does the same thing?
There was a problem hiding this comment.
The "join" endpoint is specifically for the current user, whereas the basic create endpoint just arbitrarily adds any user. We can prob simplify it in the future to make the user id in the body optional, and if it is, set it to the current user
| return this.jukeSessionService.endSession(id) | ||
| } | ||
|
|
||
| @Get(':id/membership/') |
There was a problem hiding this comment.
This needs to have jukebox_id as a param for authorization.
| @Get() | ||
| @ApiOperation({ summary: '[MEMBER] Find all jukeboxes for a club id' }) | ||
| findAll(@Query('clubId', new NumberPipe('clubId')) clubId: number) { | ||
| findAll(@Query('club_id', new NumberPipe('clubId')) clubId: number) { |
There was a problem hiding this comment.
Pipe param should be changed for consistency as well. Also not sure if the guard works with snake case
There was a problem hiding this comment.
I updated the guard to use snake case
| @Delete('accounts/:id/') | ||
| @UseInterceptors(AuthInterceptor) | ||
| async deleteSpotifyLink(@Param('id', new NumberPipe('id')) id: number) { | ||
| async deleteSpotifyLink(@CurrentUser() user: UserDto, @Param('id') id: number) { |
There was a problem hiding this comment.
Should use number pipe for validation. UserDto should have expose() decorators replaced with validators for dynamic error handling to function correctly.
There was a problem hiding this comment.
Needs validation on create and expose on TrackDto. Also expose only works if we exclude all fields by default, otherwise it is useless
There was a problem hiding this comment.
What do you mean about validation?
Uh oh!
There was an error while loading. Please reload this page.