Refactor code formatting and improve readability: standardize line breaks and indentation across various endpoint files, enhancing code clarity and maintainability. Update package version formatting in Directory.Packages.props for consistency.
This commit is contained in:
+4
-2
@@ -7,6 +7,8 @@ namespace TeleWave.Application.Admin.Roles.ChangeUserRole;
|
||||
public sealed class ChangeUserRoleCommandHandler(IRoleService roleService)
|
||||
: ICommandHandler<ChangeUserRoleCommand, Result>
|
||||
{
|
||||
public Task<Result> Handle(ChangeUserRoleCommand command, CancellationToken cancellationToken) =>
|
||||
roleService.ChangeUserRoleAsync(command.UserId, command.RoleId, cancellationToken);
|
||||
public Task<Result> Handle(
|
||||
ChangeUserRoleCommand command,
|
||||
CancellationToken cancellationToken
|
||||
) => roleService.ChangeUserRoleAsync(command.UserId, command.RoleId, cancellationToken);
|
||||
}
|
||||
|
||||
@@ -31,7 +31,11 @@ public sealed class CreateUserCommandHandler(
|
||||
var userId = createResult.Value;
|
||||
|
||||
// CreateUserAsync назначает роль по умолчанию — выставляем выбранную админом.
|
||||
var roleResult = await roleService.ChangeUserRoleAsync(userId, command.RoleId, cancellationToken);
|
||||
var roleResult = await roleService.ChangeUserRoleAsync(
|
||||
userId,
|
||||
command.RoleId,
|
||||
cancellationToken
|
||||
);
|
||||
if (!roleResult.IsSuccess)
|
||||
return Result.Failure<Guid>(roleResult.Error);
|
||||
|
||||
|
||||
@@ -4,7 +4,10 @@ namespace TeleWave.Application.Admin.Users;
|
||||
|
||||
public static class UserErrors
|
||||
{
|
||||
public static readonly Error NotFound = Error.NotFound("Users.NotFound", "Пользователь не найден.");
|
||||
public static readonly Error NotFound = Error.NotFound(
|
||||
"Users.NotFound",
|
||||
"Пользователь не найден."
|
||||
);
|
||||
|
||||
public static readonly Error CannotDeleteSelf = Error.Forbidden(
|
||||
"Users.CannotDeleteSelf",
|
||||
|
||||
Reference in New Issue
Block a user