mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-10-14 17:54:42 +00:00
20 lines
757 B
C#
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
|
|
);
|
|
}
|