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 FastEndpoints;
using Hutopy.Web.Messages.Data; using Hutopy.Web.Contents.Data;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
namespace Hutopy.Web.Contents.Handlers; namespace Hutopy.Web.Contents.Handlers;
public class GetContentsByUser( public class GetContentsByUser(
MessagingDbContext context) ContentDbContext context)
: EndpointWithoutRequest<List<Message>> : EndpointWithoutRequest<List<Content>>
{ {
public override void Configure() public override void Configure()
{ {
@@ -21,7 +21,7 @@ public class GetContentsByUser(
var userId = Route<Guid>("UserId"); var userId = Route<Guid>("UserId");
var posts = await context var posts = await context
.Messages .Contents
.Where(c => c.CreatedBy == userId) .Where(c => c.CreatedBy == userId)
.ToListAsync(cancellationToken: ct); .ToListAsync(cancellationToken: ct);