Rename GetCreatorByAlias to GetCreatorBySlug
This commit is contained in:
@@ -3,13 +3,13 @@
|
||||
namespace Hutopy.Web.Features.Contents.Handlers;
|
||||
|
||||
[PublicAPI]
|
||||
public sealed class GetCreatorByAliasRequest
|
||||
public sealed class GetCreatorBySlugRequest
|
||||
{
|
||||
public required string Name { get; set; }
|
||||
}
|
||||
|
||||
[PublicAPI]
|
||||
public class GetCreatorByAliasResponse(
|
||||
public class GetCreatorBySlugResponse(
|
||||
Guid id,
|
||||
Guid createdBy,
|
||||
DateTimeOffset createdAt,
|
||||
@@ -34,10 +34,10 @@ public class GetCreatorByAliasResponse(
|
||||
}
|
||||
|
||||
[UsedImplicitly]
|
||||
public sealed class GetCreatorByAliasRequestValidator
|
||||
: Validator<GetCreatorByAliasRequest>
|
||||
public sealed class GetCreatorBySlugRequestValidator
|
||||
: Validator<GetCreatorBySlugRequest>
|
||||
{
|
||||
public GetCreatorByAliasRequestValidator()
|
||||
public GetCreatorBySlugRequestValidator()
|
||||
{
|
||||
RuleFor(r => r.Name)
|
||||
.NotNull().WithMessage("You should specify the Name")
|
||||
@@ -46,9 +46,9 @@ public sealed class GetCreatorByAliasRequestValidator
|
||||
}
|
||||
|
||||
[PublicAPI]
|
||||
public class GetCreatorByAliasHandler(
|
||||
public class GetCreatorBySlugHandler(
|
||||
ContentDbContext context)
|
||||
: Endpoint<GetCreatorByAliasRequest, GetCreatorByAliasResponse>
|
||||
: Endpoint<GetCreatorBySlugRequest, GetCreatorBySlugResponse>
|
||||
{
|
||||
public override void Configure()
|
||||
{
|
||||
@@ -58,7 +58,7 @@ public class GetCreatorByAliasHandler(
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(
|
||||
GetCreatorByAliasRequest req,
|
||||
GetCreatorBySlugRequest req,
|
||||
CancellationToken ct)
|
||||
{
|
||||
var creatorName = req.Name.ToLower();
|
||||
@@ -67,7 +67,7 @@ public class GetCreatorByAliasHandler(
|
||||
.Creators
|
||||
.Where(c => EF.Functions.ILike(c.Slugs.Name, creatorName))
|
||||
.AsNoTracking()
|
||||
.Select(c => new GetCreatorByAliasResponse
|
||||
.Select(c => new GetCreatorBySlugResponse
|
||||
(
|
||||
c.Id,
|
||||
c.CreatedBy,
|
||||
Reference in New Issue
Block a user