Files
the-biergarten-app/web/backend/Features/Features.Users/Commands/Profile/UpdateBiography/UpdateBiographyHandler.cs
2026-09-06 01:23:51 -04:00

20 lines
757 B
C#

using Features.Users.Repository;
using MediatR;
namespace Features.Users.Commands.Profile.UpdateBiography;
/// <summary>Handles <see cref="UpdateBiographyCommand" /> by updating the stored biography.</summary>
public class UpdateBiographyHandler(IUserProfileRepository userProfileRepository)
: IRequestHandler<UpdateBiographyCommand>
{
/// <exception cref="Domain.Exceptions.NotFoundException">
/// Thrown when no user profile exists for the given user account.
/// </exception>
public Task Handle(UpdateBiographyCommand request, CancellationToken cancellationToken) =>
userProfileRepository.UpdateBiographyAsync(
request.UserAccountId,
request.Biography,
cancellationToken
);
}