Fix issue with GetContentsByUser
This commit is contained in:
@@ -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);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user