forked from Yara724/api
fix: harden profile updates and localize public errors in Persian
Preserve actor and user profile fields during partial updates and validate supported personal data. Add Persian HTTP error handling, validation translations, regression tests, and audit documentation.
This commit is contained in:
@@ -16,7 +16,7 @@ export class ProfileController {
|
||||
@Get()
|
||||
@UseGuards(GlobalGuard)
|
||||
async getProfile(@CurrentUser() user) {
|
||||
return await this.profileService.getProfileDetail(user.username);
|
||||
return await this.profileService.getProfileDetail(user.username, user.sub);
|
||||
}
|
||||
|
||||
@Patch()
|
||||
@@ -26,6 +26,10 @@ export class ProfileController {
|
||||
@CurrentUser() user,
|
||||
@Body() body: UpdateUserProfileDtoRq,
|
||||
) {
|
||||
return await this.profileService.updateProfile(user.username, body);
|
||||
return await this.profileService.updateProfile(
|
||||
user.username,
|
||||
body as Record<string, unknown>,
|
||||
user.sub,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user