Refactor user and media endpoints: remove unused GetUser and GetMedia methods, streamline AdminUserEndpoints and MediaEndpoints, and enhance metadata handling in MetadataEndpoints. Update Program.cs to remove legacy image relocation logic and improve overall code clarity.
build / backend (push) Successful in 1m14s
build / frontend (push) Successful in 35s
tests / backend-tests (push) Successful in 3m16s

This commit is contained in:
Leonid Pershin
2026-07-26 02:58:17 +03:00
parent 44e954920c
commit a0533a8ed8
50 changed files with 230 additions and 849 deletions
@@ -26,9 +26,7 @@ public class LoginCommandHandlerTests
.Returns(Result.Success(new AuthenticatedUser(userId, "alice", "user")));
_identityService
.GetProfileAsync(userId, Arg.Any<CancellationToken>())
.Returns(
new CurrentUserProfile(userId, "alice", Guid.NewGuid(), "user", IsBlocked: false)
);
.Returns(new CurrentUserProfile(userId, "alice", "user", IsBlocked: false));
_jwtTokenService
.GenerateAccessToken(Arg.Any<AuthenticatedUser>())
.Returns(("access-token", DateTimeOffset.UtcNow.AddMinutes(15)));
@@ -67,9 +65,7 @@ public class LoginCommandHandlerTests
.Returns(Result.Success(new AuthenticatedUser(userId, "alice", "user")));
_identityService
.GetProfileAsync(userId, Arg.Any<CancellationToken>())
.Returns(
new CurrentUserProfile(userId, "alice", Guid.NewGuid(), "user", IsBlocked: true)
);
.Returns(new CurrentUserProfile(userId, "alice", "user", IsBlocked: true));
var result = await CreateHandler()
.Handle(new LoginCommand("alice", "password123"), CancellationToken.None);
@@ -32,9 +32,7 @@ public class RegisterCommandHandlerTests
.Returns(Result.Success(userId));
_identityService
.GetProfileAsync(userId, Arg.Any<CancellationToken>())
.Returns(
new CurrentUserProfile(userId, "bob", Guid.NewGuid(), "user", IsBlocked: false)
);
.Returns(new CurrentUserProfile(userId, "bob", "user", IsBlocked: false));
_jwtTokenService
.GenerateAccessToken(Arg.Any<AuthenticatedUser>())
.Returns(("access-token", DateTimeOffset.UtcNow.AddMinutes(15)));