(@Body() body, @Req() req)
| 135 | }, |
| 136 | }) |
| 137 | async selfUpdate(@Body() body, @Req() req) { |
| 138 | try { |
| 139 | const { userId } = req.user; |
| 140 | await this.userServices.update(userId, body); |
| 141 | return new ServerResponse(201, 'Successfully updated'); |
| 142 | } catch (err: any) { |
| 143 | this.logger.error(`Failed to update user: ${err}`); |
| 144 | throw new HttpException(err?.code ?? err?.name ?? `${err}`, 400); |
| 145 | } |
| 146 | } |
| 147 | |
| 148 | @Get('find/:field/:value') |
| 149 | async find(@Param('field') field: string, @Param('value') value: string) { |