Adds arps as creator
This commit is contained in:
@@ -5,7 +5,7 @@ namespace Hutopy.Web.Features.Contents.Data;
|
||||
public class Creator
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid CreatedBy { get; init; }
|
||||
public Guid CreatedBy { get; set; }
|
||||
public DateTimeOffset CreatedAt { get; init; }
|
||||
[MaxLength(255)] public string Name { get; set; } = null!;
|
||||
|
||||
|
||||
@@ -36,12 +36,16 @@ public class GetCreatorByAliasHandler(
|
||||
GetCreatorByAliasRequest req,
|
||||
CancellationToken ct)
|
||||
{
|
||||
var creatorName = req.Name.ToLower();
|
||||
|
||||
var creator = await context
|
||||
.Creators
|
||||
.SingleOrDefaultAsync(
|
||||
c => EF.Functions.Like(c.Name, req.Name),
|
||||
c => EF.Functions.Like(c.Name, creatorName),
|
||||
cancellationToken: ct);
|
||||
|
||||
var creators = await context.Creators.ToListAsync(cancellationToken: ct);
|
||||
|
||||
if (creator is null) await SendNotFoundAsync(ct);
|
||||
else await SendAsync(creator, cancellation: ct);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user