|
|
@ -1,10 +1,8 @@ |
|
|
|
import { |
|
|
|
import { |
|
|
|
Body, |
|
|
|
Body, |
|
|
|
Controller, |
|
|
|
Controller, |
|
|
|
Get, |
|
|
|
|
|
|
|
HttpCode, |
|
|
|
HttpCode, |
|
|
|
Param, |
|
|
|
Patch, |
|
|
|
Post, |
|
|
|
|
|
|
|
Request, |
|
|
|
Request, |
|
|
|
Response, |
|
|
|
Response, |
|
|
|
UseGuards, |
|
|
|
UseGuards, |
|
|
@ -12,6 +10,7 @@ import { |
|
|
|
|
|
|
|
|
|
|
|
import { ConfigService } from '@nestjs/config'; |
|
|
|
import { ConfigService } from '@nestjs/config'; |
|
|
|
import type { AppConfig } from '~/interface/config'; |
|
|
|
import type { AppConfig } from '~/interface/config'; |
|
|
|
|
|
|
|
import { GlobalGuard } from '~/guards/global/global.guard'; |
|
|
|
|
|
|
|
|
|
|
|
import { AppHooksService } from '~/services/app-hooks/app-hooks.service'; |
|
|
|
import { AppHooksService } from '~/services/app-hooks/app-hooks.service'; |
|
|
|
import { UsersService } from '~/services/users/users.service'; |
|
|
|
import { UsersService } from '~/services/users/users.service'; |
|
|
@ -23,4 +22,16 @@ export class UsersController { |
|
|
|
protected readonly appHooksService: AppHooksService, |
|
|
|
protected readonly appHooksService: AppHooksService, |
|
|
|
protected readonly config: ConfigService<AppConfig>, |
|
|
|
protected readonly config: ConfigService<AppConfig>, |
|
|
|
) {} |
|
|
|
) {} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Patch(['/api/v1/user/profile']) |
|
|
|
|
|
|
|
@UseGuards(GlobalGuard) |
|
|
|
|
|
|
|
@HttpCode(200) |
|
|
|
|
|
|
|
async update(@Body() body, @Request() req, @Response() res) { |
|
|
|
|
|
|
|
res.json( |
|
|
|
|
|
|
|
await this.usersService.profileUpdate({ |
|
|
|
|
|
|
|
id: req.user.id, |
|
|
|
|
|
|
|
params: body, |
|
|
|
|
|
|
|
}), |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|