Fix issue with GetContentsByUser

This commit is contained in:
Jonathan Bourdon
2024-07-02 04:29:52 -04:00
parent 29fe6b51c1
commit 92d6c30350

View File

@@ -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);