Fix issue with GetContentsByUser
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
using FastEndpoints;
|
||||
using Hutopy.Web.Messages.Data;
|
||||
using Hutopy.Web.Contents.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Hutopy.Web.Contents.Handlers;
|
||||
|
||||
public class GetContentsByUser(
|
||||
MessagingDbContext context)
|
||||
: EndpointWithoutRequest<List<Message>>
|
||||
ContentDbContext context)
|
||||
: EndpointWithoutRequest<List<Content>>
|
||||
{
|
||||
public override void Configure()
|
||||
{
|
||||
@@ -21,7 +21,7 @@ public class GetContentsByUser(
|
||||
var userId = Route<Guid>("UserId");
|
||||
|
||||
var posts = await context
|
||||
.Messages
|
||||
.Contents
|
||||
.Where(c => c.CreatedBy == userId)
|
||||
.ToListAsync(cancellationToken: ct);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user