impement and fix user settings

This commit is contained in:
root
2025-12-22 18:26:40 -05:00
parent d19bd16210
commit 116f664e7e
7 changed files with 69 additions and 32 deletions

View File

@@ -36,24 +36,26 @@ class UserProfileController extends ControllerAbstract
* Update user profile fields
* Only editable fields can be updated. Provider-managed fields are automatically filtered out.
*
* @param array $profile Key-value pairs of profile fields to update
* @param array $data Key-value pairs of profile fields to update
*
* @example request body:
* {
* "name_given": "John",
* "name_family": "Doe",
* "phone": "+1234567890"
* "data": {
* "name_given": "John",
* "name_family": "Doe",
* "phone": "+1234567890"
* }
* }
*
* @return JsonResponse Updated profile data
*/
#[AuthenticatedRoute('/user/profile', name: 'user.profile.update', methods: ['PUT', 'PATCH'])]
public function update(array $profile = []): JsonResponse
public function update(array $data): JsonResponse
{
$userId = $this->userIdentity->identifier();
// storeProfile automatically filters out provider-managed fields
$this->userService->storeProfile($userId, $profile);
$this->userService->storeProfile($userId, $data);
// Return updated profile
$updatedProfile = $this->userService->fetchProfile($userId);