Add user avatar URL

This commit is contained in:
2025-05-13 11:31:03 +07:00
parent 4b0e87d48e
commit 621a5a745e
12 changed files with 196 additions and 31 deletions

View File

@@ -74,5 +74,18 @@ public class UserController : BaseController
var updatedUser = await _userService.UpdateAgentName(user, agentName);
return Ok(updatedUser);
}
/// <summary>
/// Updates the avatar URL for the current user.
/// </summary>
/// <param name="avatarUrl">The new avatar URL to set.</param>
/// <returns>The updated user with the new avatar URL.</returns>
[HttpPut("avatar")]
public async Task<ActionResult<User>> UpdateAvatarUrl([FromBody] string avatarUrl)
{
var user = await GetUser();
var updatedUser = await _userService.UpdateAvatarUrl(user, avatarUrl);
return Ok(updatedUser);
}
}